Advertisement
vencinachev

Js-Buttons

Apr 19th, 2021
1,066
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>Hello JS</title>
  5.         <script>
  6.             function showMessage(){
  7.                 document.getElementById("sometext").innerHTML = "Hello";
  8.             }
  9.             function clearMessage(){
  10.                 document.getElementById("sometext").innerHTML = "";
  11.             }
  12.             function redirectToUKTC(){
  13.                 window.open("https://uktc-bg.com/", '_blank');
  14.             }
  15.         </script>
  16.     </head>
  17.     <body>
  18.         <button onclick="showMessage()">Click me</button>
  19.         <button onclick="clearMessage()">Clear</button>
  20.         <button onclick="redirectToUKTC()">Redirect to UKTC website</button>
  21.         <p id="sometext"></p>
  22.     </body>
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement