HTML and script and type properties
The type property gives the language of the script or the format of the data.
If the property exists, its value must be a valid MIME type.
Script with specified type property:
document.write("Hello World!");
</script>
Try it out . . .
Browser support
The type property is supported by all major browsers.
Definitions and usages
The type property specifies the MIME type of the script.
The type property identifies the content between the label and the label.
The MIME type consists of two parts: media type and subtype. For JavaScript, the MIME type is "text/javascript".
The difference between HTML 4.01 and HTML5
In HTML5, the type property is no longer required. The default is "text/javascript".
Grammar
The property value
value | describe |
---|---|
MIME_type |
Specify the MIME type of the script.
Some common values:
See IANA MIME type , Get a complete list of standard MIME types. |
HTML and script.html