运行 ❯
获取您
的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <p id="demo" ondblclick="myFunction()">Double-click me to change my text color.</p> <p>A function is triggered when the p element is double-clicked. The function sets the color of the p element to red.</p> <script> function myFunction() { document.getElementById("demo").style.color = "red"; } </script> </body> </html>