Quackit Logo

HTML script Tag

 

The HTML script tag is used for declaring a script (such as JavaScript) within your HTML document.

Also see the HTML noscript tag for providing content to browsers that don't support your scripting language.

Example
<script type="text/javascript">
  document.write('The HTML Script tag allows you to place a
                    script within your HTML documents');
</script>
Attributes:
Attributes specific to this tag:
AttributeDescription
nameDefines the name of the parameter.
srcSpecifies a URI/URL of an external script.
typeSpecifies the scripting language as a content-type (MIME type).
languageSpecifies the scripting language, however, this attribute has been deprecated. Use the type attribute instead.
deferDeclares that the script will not generate any content. Therefore, the browser/user agent can continue parsing and rendering the rest of the page.
Other Attributes:
AttributeDescription
charsetDefines the character encoding that the script uses.
Try it yourself! HTML Editor


Also see the complete list of HTML tags


Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
                     
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!