Advertisement
Guest User

Untitled

a guest
May 27th, 2023
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. <html>
  2. <body align = "center" style = "background-color: lime">
  3. <h1>Problems Solved: </h1>
  4. <h2>A : <label id = "aC"></label></h2>
  5. <h2>B : <label id = "bC"></label></h2>
  6. <h2>C : <label id = "cC"></label></h2>
  7. <h2>D : <label id = "dC"></label></h2>
  8. <style>
  9. .button:focus {
  10. outline: none;
  11. }
  12. </style>
  13. <label style = "font-size: +30" id="count"></label><br><br>
  14. <button style = "font-size: +30; outline: none" id = "a" onclick = "counterFunca()">A</button>
  15. <button style = "font-size: +30" id = "b" onclick = "counterFuncb()">B</button>
  16. <button style = "font-size: +30" id = "c" onclick = "counterFuncc()">C</button>
  17. <button style = "font-size: +30" id = "d" onclick = "counterFuncd()">D</button>
  18. <button style = "font-size: +20" onclick = "resetFunc()">Reset Count</button>
  19. <script>
  20. acount = 0;
  21. bcount = 0;
  22. ccount = 0;
  23. dcount = 0;
  24. function counterFunca(){
  25. acount++;
  26. document.getElementById("aC").innerHTML = acount;
  27. const bt = document.getElementById("a");
  28. bt.style.backgroundColor = "lime";
  29. }
  30.  
  31. function counterFuncb(){
  32. bcount++;
  33. document.getElementById("bC").innerHTML = bcount;
  34. const bt = document.getElementById("b");
  35. bt.style.backgroundColor = "lime";
  36. }
  37.  
  38. function counterFuncc(){
  39. ccount++;
  40. document.getElementById("cC").innerHTML = ccount;
  41. const bt = document.getElementById("c");
  42. bt.style.backgroundColor = "lime";
  43. }
  44.  
  45. function counterFuncd(){
  46. dcount++;
  47. document.getElementById("dC").innerHTML = dcount;
  48. const bt = document.getElementById("d");
  49. bt.style.backgroundColor = "lime";
  50. }
  51. function resetFunc() {
  52. acount = 0;
  53. bcount = 0;
  54. ccount = 0;
  55. dcount = 0;
  56. document.getElementById("aC").innerHTML = acount;
  57. document.getElementById("bC").innerHTML = bcount;
  58. document.getElementById("cC").innerHTML = ccount;
  59. document.getElementById("dC").innerHTML = dcount;
  60. document.reload();
  61. }
  62. </script>
  63. </body>
  64. </html>
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement