Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- </head>
- <body>
- <h1>JavaScript example </h1>
- <p id ="demo">
- JavaScript can change the style of an HTML element.
- </p>
- <script>
- function myFunction() {
- x=document.getElementById("demo")
- x.style.color="#ff0000";
- }
- </script>
- <button type="button" onclick="myFunction()">Click Me!</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement