Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to 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>