Created
July 31, 2013 08:53
-
-
Save tangyangzhe/6120477 to your computer and use it in GitHub Desktop.
js取消浏览器双击选中的文本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clearSelection() { | |
if(document.selection && document.selection.empty) { | |
document.selection.empty(); | |
} else if(window.getSelection) { | |
var sel = window.getSelection(); | |
sel.removeAllRanges(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment