You are here: Reference > JavaScript > client-side > HTML DOM > properties > language (script, a, abbr, ...)

language property (script, a, abbr, ...)

Browser support:
Sets or retrieves the scripting language for the current element. Use it only for the script element.
This property is deperecated in HTML 4.01.

Syntax:

object.language;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: language

Possible values:

String that sets or retrieves the scripting language.
Some of the supported languages:
JavaScript
The language is JavaScript.
JavaScript1.1
The language is JavaScript 1.1.
JavaScript1.2
The language is JavaScript 1.2.
JavaScript1.3
The language is JavaScript 1.3.
JavaScript1.4
The language is JavaScript 1.4.
JavaScript1.5
The language is JavaScript 1.5.
JavaScript1.6
The language is JavaScript 1.6.
JavaScript1.7
The language is JavaScript 1.7.
JavaScript1.8
The language is JavaScript 1.8.
JScript
The language is Microsoft JScript.
VBS
Same as VBScript.
VBScript
The language is Microsoft Visual Basic Scripting Edition.
XML
The language is Extensible Markup Language (XML).
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the language attribute:
<head>
    <script type="text/javascript" language="JavaScript"></script>
</head>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the language property:
<head>
    <script type="text/javascript" language="JavaScript"></script>

    <script type="text/javascript">
        function GetScriptLang () {
            var scripts = document.getElementsByTagName ("script");
            for (var i = 0; i < scripts.length; i++) {
                alert (scripts[i].language);
            }
        }
    </script>
</head>
<body>
    <button onclick="GetScriptLang ();">Get scripting language!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content