html5 Site Icon CSS3 Site Icon CSS Site Icon

HTML4 Reference

HTML <script> tag

Definition

The <script> tag and it's closing </script> tag define a scripting language within the HTML document.

Example


<html  xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Appears in browser toolbar, favourites and search engime results.</title>

  <script type="text/javascript" src="../js/jquery.js"></script>

</head>

<body>
</body>
</html>

Required Attributes

type specifies the MIME type of a script.


  <script type="text/javascript" src="../js/jquery.js"></script>

Optional Attributes

defer - limited browser support - specifies execution of the script is delayed until the page has loaded.

charset specifies the character set of the linked document.


  <script type="text/javascript" charset="ISO-8859-1"></script>

src specifies the URL location of the external script.


  <!-- relative URL to this document -->
  <script type="text/javascript" src="../js/jquery.js"></script>

  <!-- Absolute URL -->
  <script type="text/javascript" src="http://htmldoctor.info/js/jquery.js"></script>

Common Attributes

NONE

Language Attributes

NONE

Event Attributes

NONE



<samp> tags    << Prev          Next >>  <select> tag

go to home page Homepage go to top of page Top