怎么做淘宝链接网站,制作网站的主题,包装材料营销型网站,如何让百度搜索到自己的网站小编典典用普通的HTML无法做到这一点#xff0c;因此JSF在这里也无法为您做很多事情。如果您仅针对体面的浏览器#xff0c;则只需使用CSS3#xff1a;.unselectable {-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: n…小编典典用普通的HTML无法做到这一点因此JSF在这里也无法为您做很多事情。如果您仅针对体面的浏览器则只需使用CSS3.unselectable {-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}Unselectable label如果您还想涵盖较旧的浏览器请考虑以下JavaScript后备SO question 2310734window.onload function() {var labels document.getElementsByTagName(label);for (var i 0; i labels.length; i) {disableSelection(labels[i]);}};function disableSelection(element) {if (typeof element.onselectstart ! undefined) {element.onselectstart function() { return false; };} else if (typeof element.style.MozUserSelect ! undefined) {element.style.MozUserSelect none;} else {element.onmousedown function() { return false; };}}Try to select this如果您已经在使用那么这是另一个示例它disableSelection()向jQuery添加了一个新函数以便您可以在jQuery代码中的任何位置使用它SO question 2310734 with jQuery$.fn.extend({disableSelection: function() {this.each(function() {if (typeof this.onselectstart ! undefined) {this.onselectstart function() { return false; };} else if (typeof this.style.MozUserSelect ! undefined) {this.style.MozUserSelect none;} else {this.onmousedown function() { return false; };}});}});$(document).ready(function() {$(label).disableSelection();});Try to select this2020-05-10