There are a few XHTML/HTML attributes which are standard and associated to all the XHTML/HTML tags. These attributes are listed here with brief description −
Core Attributes
Not valid in base, head, html, meta, param, script, style, and title elements.
Attribute | Value | Description |
---|---|---|
class | class_rule or style_rule | It specifies the class of the element. |
id | id_name | It specifies a unique id for the element. |
style | style_definition | It specifies an inline style definition. |
title | tooltip_text | It specifies a text to display in a mouse tip. |
Language Attributes
The lang attribute indicates the language being used for the enclosed content. The language is identified using the ISO standard language abbreviations, such as fr for French, en for English, and so on. More codes and their formats are described at www.ietf.org.
Not valid in base, br, frame, frameset, hr, iframe, param, and script elements.
Attribute | Value | Description |
---|---|---|
dir | ltr | rtl | It is used to set the text direction. |
lang | language_code | It is used to set the language code. |
Microsoft Proprietary Attributes
Microsoft introduced a number of new proprietary attributes with the Internet Explorer 4 and higher versions.
Attribute | Value | Description |
---|---|---|
accesskey | character | It is used to set a keyboard shortcut to access an element. |
language | String | This attribute is specifies the scripting language which is used with the script bound to the element, typically through an event handler attribute. Its possible values might include JavaScript, jScript, VBS, and VBScript. |
tabindex | Number | It is used to set the tab order of an element. |
contenteditable | Boolean | It allows users to edit content rendered in internet explorer 5.5 or greater. Its possible values are true or false. |
disabled | Boolean | The disabled attribute makes the element appear faded and will not respond to user input. Its possible values are true or false. |
hidefocus | On or Off | This proprietary attribute, introduced with internet explorer 5.5, hides focus on an element's content. It specifies that focus must be applied to the element using the tabindex attribute. |
unselectable | On or Off | It is used to prevent content displayed in internet explorer 5.5 from being selected. |