JS禁止双击选中文本(两种方法)
onselectstart方法
//ie和chrome都支持onselectstart事件,但是firefox不支持,所以firefox使用CSS来控制
<body onselectstart = "return false" style= { -moz-user-select : none}></body>
清空选中
window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty()