Menu ▼

Previous Next

<script> :

<script> tag will be used to write javascript, vb script and other scripting languages. We can give reference to the external Script files.

Syntax :

<script language="javascript" src="external js location here..."></script>

<script language="javascript">

    function functionname(parameters) {

        //code to be executed here.



Example :



    <title>HTML Tutorial</title>

    <script language="javascript">

        function showtime() {

            alert(new Date().toLocaleString());





    <input type="button" value="Show time" onclick="showtime();" />



Output :
HTML Tutorial
Previous Next