HTML Attributes

id

The id attribute

The global id attribute uniquely identifies an element within a document.

class

The class attribute

The global class attribute, used for CSS styling and for querySelector selection.

style

The style attribute

The global style attribute for inline CSS directly on an element.

lang

The lang attribute

The global lang attribute marks the language of text, important for screen readers and translators.

hidden

The hidden attribute

The global boolean hidden attribute hides an element from both sighted users and screen readers.

tabindex

The tabindex attribute

The global tabindex attribute controls Tab-key sequence and whether an element is focusable.

href

The href attribute

The href attribute of a and link elements: the URL a link or resource points to.

src

The src attribute

The src attribute of img, script, video, audio, iframe: the URL of a resource to load.

alt

The alt attribute

The alt attribute of img: a required text description for accessibility and fallback.

type

The type attribute

The type attribute for input (text/number/checkbox etc.), button, and script (script type).

value

The value attribute

The value attribute for input, option, li, progress, meter: the current or initial value.

placeholder

The placeholder attribute

The placeholder attribute for input and textarea: a hint that is not a substitute for a label.

required

The required attribute

The boolean required attribute for input, select, textarea: built-in HTML5 required-field validation.

disabled

The disabled attribute

The boolean disabled attribute for input, button, select, textarea, fieldset: inactive and excluded from form submission.

target

The target attribute

The target attribute of a and form: which browsing context (tab/frame) to open the result in.