我要写一个专用的文本编辑器,用了个可编辑的div,现在想取div中焦点所在的结点或是文本,举个例子
111111
abc123456
[code="java"]
dddd
ddddd
[/code]
弄了一会,你看看这个应该合适你的吧,可以在此基础上改改。
事件绑定函数:[color=red]参数this是关键[/color]
[code="JavaScript"]function fun(this){
var test = this.nodeValue;
}[/code]
比如click事件:onclick="fun(this);"