没遇到过的问题 怎么得到用鼠标选择的文本的内容 急!!!在线等 <input onclick='document.execCommand("Copy")'> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 测试测试测试测试测试测试测试测试测试测试<input type="button" UNSELECTABLE="on" onclick="document.execCommand('Copy')" value="get selected Text"> <div id=m>dsfdfd gdfghfdgdf dfh dfh dfh df</div><input type="button" UNSELECTABLE="on" onclick="document.execCommand('Copy');alert(m.innerText.indexOf(window.clipboardData.getData('Text')))" value="get selected Text"> 谢谢楼上的大哥,我试了可以得到被选择的内容,怎么才能得到被选择的内容在整段文字中的位置呢?用indexOf应该不行,因为一段文字里可能有许多重复的文字,被选的这几个字之前可能有与它们相同的文字,这样就得不到被选文字的正确位置了,是不是没有办法得到呢? 求鼠标移入元素时候知道鼠标从哪个方向移入的. 幫我看看这个JS哪里出错了? EXT 清空 上传控件 怎么用OLEDB连接oracle 关于jquery插件Validation的一个问题 如何在js代码中声明二维动态数组 请专家指点迷津,如何设置文本框只能输整数,能带+-号,首位数不能是0的JS完整代码效果,谢谢 。 js怎么得到当前网页字符的编码方式? 通过在服务器端安装摄像头,如何使用webServer的方式在客户端看到视频录像? 请问,如何使用JScript历遍整个表单? 怎么才知道你的javascript的版本. 在选择表格的一行时,我想让这一行背景色改变
<input type="button" UNSELECTABLE="on" onclick="document.execCommand('Copy')" value="get selected Text">
<input type="button" UNSELECTABLE="on" onclick="document.execCommand('Copy');alert(m.innerText.indexOf(window.clipboardData.getData('Text')))" value="get selected Text">