lang property
Specifies or returns the language of the element.
The value of the lang property is used by user agents to choose language-specific quotations, numbers and glyphs, but it also helps spell checkers and search engines.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: lang |
Possible values:
String that sets or retrieves the language code. For more information about language codes click here.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the lang attribute:
|
||||
<span lang="en">Welcome</span> <span lang="fr">Bienvenue</span> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the lang property:
|
||||
<head> <script type="text/javascript"> function GetLang () { var span = document.getElementById ("mySpan"); alert (span.lang); } </script> </head> <body> <span id="mySpan" lang="en">Welcome</span> <button onclick="GetLang ();">Get lang!</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
HTML elements:
a, abbr, acronym, address, applet, area, b, basefont, bdo, big, blink, blockquote, body, button, caption, center, cite, code, col, colgroup, comment, dd, del, dfn, dir, div, dl, dt, em, embed, fieldset, font, form, frameset, h1, h2, h3, h4, h5, h6, head, hr, html, i, iframe, img, input:button, input:checkbox, input:file, input:hidden, input:image, input:password, input:radio, input:range, input:reset, input:search, input:submit, input:text, ins, isindex, kbd, keygen, label, legend, li, link, listing, map, marquee, menu, meta, nobr, noframes, noscript, object, ol, optgroup, option, p, plaintext, pre, q, rt, ruby, s, samp, script, select, small, span, strike, strong, style, sub, sup, table, tbody, td, textarea, tfoot, th, thead, title, tr, tt, u, ul, var, xmp
External links:
User Contributed Comments