document对象有createRange()方法吗?有的话,是什么意思? document.selection.createRange() 根据当前文字选择返回 TextRange 对象,或根据控件选择返回 ControlRange 对象。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 判断文本是否被选中,如:<input type=button value=判断有无文字选中 onclick='alert("有无选中 \? "+ (document.selection.createRange().text!=""))'> <input type=button value=得到选中的文字 onclick='alert("网页里被选中的文字 : "+ document.selection.createRange().text)'> [问]鼠标经过,怎么改变另外一个地方的背景图片 哪个高手闲着无事,来练练手,顺便帮我下呀!!! ++++++extjs的grid中,如何设置指定单元格的颜色+++++++ 遍沥页面所有控件 js代码改变session的值? js搞的头都大了,大家可能也有我这样的问题 层内移动为什么鼠标为什么会触发onmouseout事件? 请问这几个属性是做什么的? 正则表达式何解 参数传递问题来了! vbs 如何引用正则匹配的内容 JavaScript还能这样写一个字符串变量的?不太理解!
<input type=button value=判断有无文字选中
onclick='alert("有无选中 \? "+ (document.selection.createRange().text!=""))'>
<input type=button value=得到选中的文字
onclick='alert("网页里被选中的文字 : "+ document.selection.createRange().text)'>