script

Support

Specifies a script block within a HTML document.

The script element allows authors to write or include script codes into HTML documents.

Use the type attribute to specify the language for a script block. If the type attribute is not specified (it was only required in older browsers), JavaScript (JScript) is the basic interpreter for the code.

The script tag should be placed in the head or in the body element.

Example

<head>
<script type="text/javascript" src="sample.js"></script>
<script type="text/javascript">
window.onload = alert ("Hello World!");
</script>
</head>