兼容各个浏览器:禁止鼠标选择文字事件

Css

#text{
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    -o-user-select:none;
    -ms-user-select:none; 
}

html

<div id="text" onselectstart="return false;" unselectable="on">拖动滑块验证</div>

猜你喜欢

转载自www.cnblogs.com/duanzhenzhen/p/10190918.html