You are here: Reference > JavaScript > client-side > HTML DOM > properties > language (script, a, abbr, ...)
language property (script, a, abbr, ...)
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:
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:
The language is JavaScript. | |||||||
The language is JavaScript 1.1. | |||||||
The language is JavaScript 1.2. | |||||||
The language is JavaScript 1.3. | |||||||
The language is JavaScript 1.4. | |||||||
The language is JavaScript 1.5. | |||||||
The language is JavaScript 1.6. | |||||||
The language is JavaScript 1.7. | |||||||
The language is JavaScript 1.8. | |||||||
The language is Microsoft JScript. | |||||||
Same as VBScript. | |||||||
The language is Microsoft Visual Basic Scripting Edition. | |||||||
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?
|
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?
|
Supported by objects:
HTML elements:
a, abbr, acronym, address, applet, area, b, bdo, big, blockquote, body, button, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, embed, fieldset, font, form, frame, frameset, h1, h2, h3, h4, h5, h6, hr, html, i, iframe, img, input:button, input:checkbox, input:file, input:hidden, input:image, input:password, input:radio, input:reset, input:submit, input:text, ins, isindex, kbd, label, legend, li, listing, map, marquee, menu, nobr, noframes, object, ol, optgroup, option, p, plaintext, pre, q, rt, ruby, s, samp, script, select, small, span, strike, strong, sub, sup, table, tbody, td, textarea, tfoot, th, thead, tr, tt, u, ul, var, xml, xmp
Related pages:
External links:
User Contributed Comments