在IE浏览器中,当input获得焦点时,点击有unselectable="on"属性的标签时,不会触发onblur事件。, < !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">< html> < head> < title>html的标签unselectable=on属性的作用 < meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> < /head>
< p> < p>unselectable="on" < p>span测试2 unselectable="" < p> Test1 elements sothat it appears as follows:
div测试1 unselectable="on"
< p>div测试2 unselectable=""
< /html>< script language="javascript" type="text/javascript"> (function () { var txt = document.getElementById("txt"); txt.onblur = function () { alert('失去焦点了'); } })();< /script>, 在IE下给DIV设置unselectable与onselectstart属性,可以让div的内容不能选中,这个功能在很多情况下,非常有用,但是他的bug太明显,, 目前我还没找到很好的解决方案,要么在body里用onselectstart="return false;",但是那会导致整个页面都无法选中;或者在所有div或者类似DIV的容器里都要设置onselectstart="return false;",才能彻底解决。. Replied on June 10, 2010. HTML Text Extractor is the simplest and easiest way to view and save the HTML and Text from any webpage. How to make HTML Text unselectable. Rich Text Editor, Asp.net chat, file upload, control ... One issue I found was that UNSELECTABLE="ON" contenteditable="false" doesnt work in Firefox, however a solution may be to add . How to make HTML Text unselectable [duplicate] Ask Question Asked 11 years, 6 months ago. Found inside â Page 177This divcan't be selected
This div can be selected
I don't know why someone would want to override unselectable styles, but the first idea that popped into my head was a different background color so folks knew not to even bother to select text in the unselectable controls. Found inside â Page 111:text: can be selected. ...
Unselectable text.