<script> HTML Tag

In this article we will discuss about how to use the script tag in HTML.
  • 1587

The script tag allow us to include the scripting language such as JavaScript in our HTML document which is used to provide the dynamic functionality in our document. It is always specified within the head tag in HTML.

HTML Code:

<html>

<head>

    <script type="text/javascript">

        function displayName() {

            document.getElementById("hiiii").innerHTML = "Hello welcome to all to the dotnetheaven";

        }

    </script>

</head>

<body>

    <h1>

        My First Web Page</h1>

    <p id="hiiii">

        This is a paragraph.</p>

    <button type="button" onclick="displayName()">

        Display Name</button>

</body>

</html>

Output:

 tttttttttttttttttttttt.jpg

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2019 DotNetHeaven. All rights reserved.