CodeMirror event

由于要用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");  
});
相关文章
相关标签/搜索