<!DOCTYPE html>
<html>
<body>
<p>本例演示如何将 "ondblclick" 事件分配给 p 元素。</p>
<p id="demo" ondblclick="myFunction()">双击我。</p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "I was double-clicked!";
}
</script>
</body>
</html>