document.onselectstart的使用

641 阅读1分钟
// 禁止选中网页中的文字
document.onselectstart = function(()=> {
    return false;
})
// 网页中的文字可选中
document.onselectstart = function(()=> {
    return true;
})