HTML Script Element
The HTML script element is used to embed script in the header of an HTML document. The HTML script element may be included inside either the HTML head element or HTML body element. HTML script element attributes include:
- CHARSET - The character encoding of the script such as "ISO-8859-1".
- DEFER - The script will not be parsed until the document is loaded.
- LANGUAGE - Describes the name of the script language. This attribute is depreciated.
- SRC - The external location where the script may be. In this case the script in between the SCRIPT tags is not used, but an external file is loaded.
- TYPE - Describes the content type of the script language.
The script embedded in the header between the <script> and </script> tags can be used to take actions based on user actions or it may be perform functions which are invoked by a timer. One item the client side script program may perform is to check user input to a form and action may be taken when the user submits the form or clicks on a button.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
The language attribute in the example may be left out.