Advertisement
Guest User

Some javascript event

a guest
Apr 22nd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1- the content of the <h1> element is changed when a user clicks on it:
  2.  
  3.  
  4. <!DOCTYPE html>
  5. <html>
  6. <body>
  7.  
  8. <h1 onclick="this.innerHTML='Ooops!'">Click on this text!</h1>
  9.  
  10. </body>
  11. </html>
  12.  
  13. 2-clic for the time display
  14. <!DOCTYPE html>
  15. <html>
  16. <body>
  17.  
  18. <p>Click the button to display the date.</p>
  19.  
  20. <button onclick="displayDate()">The time is?</button>
  21.  
  22. <script>
  23. function displayDate() {
  24.     document.getElementById("demo").innerHTML = Date();
  25. }
  26. </script>
  27.  
  28. <p id="demo"></p>
  29.  
  30. </body>
  31. </html>
  32.  
  33. for download it completly:http://gsul.me/aO5t
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement