ahmed0saber

Color Tester in HTML , CSS , JS

Nov 21st, 2020 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <title>Color Tester</title>
  4. <script>
  5. function change(){
  6. HexColor=document.getElementById("a1").value;
  7. document.body.style.background=HexColor;}
  8. </script>
  9. <style>
  10. #ss{border:2px solid #000000;
  11. position:absolute;
  12. top:25%;
  13. left:25%;
  14. margin:auto;
  15. text-align:center;
  16. background-color:#BBBBBB;}
  17. </style>
  18. </head>
  19. <body>
  20. <br/><br/><br/>
  21. <div id="ss"><br/>
  22. <input type="text" placeholder="For Example:- #F5AC42" value="" id="a1"/><br/><br/>
  23. <button onclick="change()">Click To Change Color</button><br/><br/>
  24. </div>
  25. </body>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment