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