因为要用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");
});