Since HTML 4.x, the type attribute in a script tag specifies the scripting language of the element's content and overrides the default scripting language. The scripting language is specified as a content type (for example, 'text/javascript'). Authors must provide a value for this attribute. There is no default value for this attribute.
But after HTML5 was released, the type attribute in script tags became optional. The type attribute gives the language of the script or format of the data. If the attribute exists, its value must be a valid MIME type. The charset parameter must not be specified. The default, which is used if the attribute is absent, is 'text/javascript'.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Since HTML 4.x, the type attribute in a script tag specifies the scripting language of the element's content and overrides the default scripting language. The scripting language is specified as a content type (for example, 'text/javascript'). Authors must provide a value for this attribute. There is no default value for this attribute.
But after HTML5 was released, the type attribute in script tags became optional. The type attribute gives the language of the script or format of the data. If the attribute exists, its value must be a valid MIME type. The charset parameter must not be specified. The default, which is used if the attribute is absent, is 'text/javascript'.