I am using Codemirror's plugin for textarea but I am not able to retrieve the value of textarea.
Code:
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
mode: "text/x-csrc"
});
function showCode()
{
var text = editor.mirror.getCode();
alert(text);
}
It is showing the error:
editor.getCode() is not a function.
console.dir(editor.morror)
andconsole.dir(editor)
show in chrome? – Bardo