samedi 28 juin 2014

CodeMirror using Jqyery .keyup on editor textarea


Vote count:

0




I want to getValue of Codemirror editor on keyup but it did not work. Here's the fiddle



var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor = CodeMirror.fromTextArea(document.getElementById("HTML"), {mode: mixedMode, lineNumbers: true });

$(document).ready(function(){
$("#HTML").keyup(function(){
html = editor.getValue();
alert(html);
});
});


asked 25 secs ago






Aucun commentaire:

Enregistrer un commentaire