由于要用UiKit的markdwon模块编辑器,所以打仗了CodeMirror
下面是事宜绑定的基础写法,和jQuery靠近.
var textarea = document.getElementById('block');
var editor = CodeMirror.fromTextArea(textarea, {
lineNumbers: false,
content: textarea.value,
});
editor.on("blur", function(){
console.log("onBlur");
});