You are here: Reference > HTML > attributes > type (script)

type attribute (script)

Browser support:
Sets the type of scripting language to use.
In some older browsers the value of this attribute must be set, because there is no default value for this attribute.
JavaScript page for this attribute: type. You can find other example(s) there.

Possible values:

String that sets the type of scripting language.
One of the following values:
text/ecmascript
The language is ECMAScript.
text/javascript
The language is JavaScript.
text/jscript
The language is Microsoft JScript.
text/vbs
Same as text/vbscript.
text/vbscript
The language is Microsoft Visual Basic Scripting Edition.
text/xml
The language is XML.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the type attribute:
Code
javascript.js
<head>
    <script type="text/javascript" src="javascript.js"></script>
</head>
<body>
    <button onclick="HelloWorld ();">Call HelloWorld function</button>
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content