Note: If you don't know what an element/tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.
Table of contents
Bypass table of contentsThe HTML script element is used to insert client side script code into a document. This can be achieved in two ways: inserting the code directly as content of this element or referring to an external file containing script code with the "src" attribute. In the second case, user agents should ignore the content of the element.
There are many client side languages that can be inserted in an HTML document, and this must be specified in the "type" attribute.
In the first example, a pice of script is inserted directly in the document.
In the second example, an external file containing script code is referred using the "src" attribute.
This attribute specifies the scripting language of the code as a content-type. This attribute is intended to replace the deprecated attribute "language".
Points to an external resource where the script code is declared. When this attribute is present, user agents should ignore the content of the element.
Defines the character encoding of the resource pointed in the "src" attribute. The value of this attribute doesn't refer in any way to the content of the element, which uses the character encoding of the document.
When present, this boolean attribute indicates that the script won't add or change the document's content, allowing browser to continue rendering the document while the script is being loaded.
Remember that in XHTML, boolean attributes must take their own names as value (e.g., attr_name="attr_name").
This attribute has been deprecated in HTML 4.01. Therefore its use is no longer recommended.
Indicates the scripting language of the code as a language identifier. Language identifier values aren't standard.
This element doesn't support events.
See a complete list and information about events in HTML
Diseño y desarrollo: Latitud29.com