<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
body {
text-align: center;
vertical-align:middle;
height: 39px;
overflow: hidden;
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;/**禁止选中文字*/
}
</style>
</head>
<body>
<p id="banselect">
1w1irqoiqhri1oi341oi34j34nh3ji24jo
3j42i34123hkl34j3i432jkhhjk2j3h4jp
</p>
<script>
var target=document.getElementById("banselect");
target.onselectstart=function(){ //禁止选取
return false;
}
</script>
</body>
</html>
禁止选取网页中的文字
最新推荐文章于 2022-10-02 22:21:23 发布