Google News
logo
HTML - Interview Questions
Explain the script tag.
Script tag can be inside the head or body tag of the HTML code. This tag is executed when the browser reaches that part of the document.
  
<html>    
      <body>    
        <h2>HTML Script Tag Example</h2>    
        <script>
           var x = 5;
           var y = 6;
           var result = x + y;
         alert("X + Y is equal to " + result);                                                                                  
        </script> 
      </body>    
</html>
Advertisement