Advertisement
afsarwebdev

On hover text change of button

Jul 25th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. HTML:
  2. <a href="#" onmouseover="mOver(this)" onmouseout="mOut(this)" >Hover me</a>
  3. CSS:
  4. a {
  5. background-color: orange;
  6. display: inline-block;
  7. padding: 20px 20px;
  8. text-decoration: none;
  9. color: #fff;
  10. text-transform: uppercase;
  11. font-size: 25px;
  12. transition: 0.4s all;
  13. width: 180px;
  14. height: 30px;
  15. text-align: center;
  16. }
  17.  
  18. a:hover {
  19. background: blue;
  20. }
  21. JS:
  22. function mOver( obj ){
  23. obj.innerHTML = "Go...!"
  24. }
  25. function mOut( obj ){
  26. obj.innerHTML = "Hover me"
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement