<!DOCTYPE html>
<html>
<body>
<p id="demo" ondblclick="myFunction()">双击我更改我的文本颜色。</p>
<p>双击 p 元素时会触发一个函数。 该函数将 p 元素的颜色设置为红色。</p>
<script>
function myFunction() {
document.getElementById("demo").style.color = "red";
}
</script>
</body>
</html>
你的E-mail:
网页地址:
描述: