手掌心
如果你使用jQuery UI,有一个方法,但它只能处理鼠标选择(即CTRL+ A仍在工作):$('.your-element').disableSelection(); // deprecated in jQuery UI 1.9如果您不想使用jQuery UI,代码非常简单:$(el).attr('unselectable','on')
.css({'-moz-user-select':'-moz-none',
'-moz-user-select':'none',
'-o-user-select':'none',
'-khtml-user-select':'none', /* you could also put this in a class */
'-webkit-user-select':'none',/* and add the CSS class here instead */
'-ms-user-select':'none',
'user-select':'none'
}).bind('selectstart', function(){ return false; });