键盘事件绑定:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
< html >
< head >
< base href="<%=basePath%>">
< title >Insert title here</ title >
< script type = "text/javascript" src="<%=basePath %>ckk/ckeditor/ckeditor.js"></ script >
</ head >
< body >
< form action = "" method = "post" >
< textarea class = "ckeditor" name = "context" id = "context" ></ textarea >
< input type = "button" value = "提交" onclick = "test()" />
</ form >
< div id = "info" ></ div >
${param.context } < script type = "text/javascript" >
//键盘事件绑定
var editor = CKEDITOR.replace('context');
CKEDITOR.instances["context"].on("key", function(evt){
document.getElementById("info").innerHTML =editor.getData();
});
</ script >
</ body >
</ html >
|
版权声明:原创作品,如需转载,请注明出处。否则将追究法律责任
本文转自 l363130002 51CTO博客,原文链接:http://blog.51cto.com/liuyj/1575788