type
Definition and Usage
The type attribute specifies the Internet media type (formerly known as MIME type) of a script.
The type attribute identifies the content between the <script> and </script> tags.
The media type consists of two parts: one media type and one subtype. For JavaScript, the media type is “text/javascript”.This attribute identifies the scripting language of code embedded within a script
element or referenced via the element’s src
attribute. This is specified as a MIME type; examples of supported MIME types include text/javascript
, text/ecmascript
, application/javascript
, and application/ecmascript
. If this attribute is absent, the script is treated as JavaScript.If the MIME type specified is not a JavaScript type the content embedded within its tags is treated as a data block which won’t be processed by the browser.
Attribute Values
Value | Description |
---|---|
media_type | Specifies the Internet media type of the script.
Some common values:
|