<!DOCTYPE html>
<html>
<head>
<title>sdfsd</title>
<style type="text/css">
#box{
width: 200px;
height: 200px;
background-color: pink;
}
</style>
</head>
<body>
<div id="box">
sdfsdsdfsdfsd
</div>
<script type="text/javascript">
window.onload = function(){
var oBox = document.getElementById('box');
// 给oBox添加双击event
oBox.ondblclick = function(){
}
}
</script>
</body>
</html>
上面的div ,如果双击,就会有如下显示:
为了阻止,双击选中文字