Menu ▼

Previous Next

<head> :

<head> will be the first child tag of <html>. we will declare the page title, meta keywords, meta description, css styles, javascript and their references here.

Syntax :

<head>

    <title>HTML Tutorial</title>

    .........

</head>


Example :

<html>

<head>

    <title>HTML Tutorial</title>

    <meta name="keywords" content="html tutorial" />

    <style type="text/css">

        .divexample

        {

            background-color: Red;

            color: White;

            padding:20px;

        }

    </style>

    <script language="javascript">

        function showtime() {

            document.getElementById("divtime").innerHTML = new Date().toLocaleString();

        }

    </script>

</head>

<body>

    <form>

    <div id="divtime" class="divexample">

        Click the below button to show time.

    </div>

    <input type="button" onclick="showtime();" value="Click me" />

    </form>

</body>

</html>

 


Output :
HTML Tutorial
Click the below button to show time.
Previous Next




Search dotnetlearners.com