Advertisement
winone1208

JS onMouseOver onMouseOut

Nov 12th, 2015
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <body>
  3.  
  4. <img onmouseover="bigImg(this)" onmouseout="normalImg(this)" border="0" src="smiley.gif" alt="Smiley" width="332" height="332">
  5.  
  6.  
  7.  
  8. <script>
  9. function bigImg(x) {
  10.     x.style.height = "64px";
  11.     x.style.width = "64px";
  12. }
  13.  
  14. function normalImg(x) {
  15.     x.style.height = "32px";
  16.     x.style.width = "32px";
  17. }
  18. </script>
  19.  
  20. </body>
  21. </html>
  22.  
  23.  
  24.  
  25. <html>
  26. <body>
  27. <h1 id="demo" onmouseover="mouseOver()" onmouseout="mouseOut()">Mouse over me</h1>
  28. <script>
  29. function mouseOver() {
  30.     document.getElementById("demo").style.color = "red";
  31. }
  32. function mouseOut() {
  33.     document.getElementById("demo").style.color = "black";
  34. }
  35. </script>
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement