Creating an alert button


<!DOCTYPE html>


<html>


  <head>


    <title>background change</title>


  </head>


  <body>


    <button id=”tio”>click</button>


    <script>
      document.getElementById(“tio”).onclick= function(){
      alert(‘hello, i would love to know u more.’)
      }
    </script>


  </body>


</html>


OUTPUT:

This is the output of the alert code above.

Leave a Comment