Guest User

Untitled

a guest
Jun 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <style>
  2. .btn {
  3. background-color: #FFFFFF; /* #4CAF50; /* Green */
  4. border: none;
  5. color: white;
  6. padding: 8px 16px;
  7. text-align: center;
  8. text-decoration: none;
  9. display: inline-block;
  10. font-size: 16px;
  11. margin: 4px 2px;
  12. -webkit-transition-duration: 0.4s; /* Safari */
  13. transition-duration: 0.4s;
  14. cursor: pointer;
  15. }
  16. .btn1 {
  17. background-color: white;
  18. color: black;
  19. border: 2px solid #4CAF50;
  20. }
  21. .btn1:hover {
  22. background-color: #4CAF50;
  23. color: white;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28.  
  29. <h2> Boton con hover on </h2>
  30.  
  31. <button id="Btn11" data-color="rgb(229, 57, 53)" class="btn btn1" onclick="myFunctio1('Btn11')">Dar Click</button>
  32.  
  33. <script>
  34. var count1=1;
  35. function myFunctio1(btn) {
  36. var b1 = document.getElementById(btn).value;
  37. var c1 = 0;
  38. if (count1 == 0) {
  39. document.getElementById(btn).style.background = 'white';
  40. document.getElementById(btn).style.color = 'black';
  41. c1 = 0;
  42. count1 = 1;
  43. }
  44. else {
  45. document.getElementById(btn).style.background = 'blue';
  46. document.getElementById(btn).style.color = 'white';
  47. c1 = 1;
  48. count1 = 0;
  49. }
  50. return b1,c1;
  51. }
  52.  
  53. </script>
Add Comment
Please, Sign In to add comment