html设置禁止选

武飞扬头像
PHP中文网
帮助4

html设置禁止选中的方法:

1、通过在body标签中添加如下属性:

<body "return false;" onselectstart="return false">

前面一句是禁止右键的,后面一句是禁止复制的。

2、在js中添加如下两行语句:

//禁止页面选择以及鼠标右键
document.function(){return false;}; 
document.onselectstart=function(){return false;};

本文出至:学新通

系列文章
更多 更多
同类精品
更多 更多
我要评论
我的头像
精彩评论
继续加载