Easy Tutorial
❮ Ev Onload Att Output Name ❯

HTML <input> checked Attribute

HTML <input> Tag

Example

An HTML form with a pre-selected checkbox:


Browser Support

All major browsers support the checked attribute.


Definition and Usage

The checked attribute is a boolean attribute.

The checked attribute specifies that an <input> element should be pre-selected when the page loads.

The checked attribute applies to <input type="checkbox"> and <input type="radio">.

The checked attribute can also be set after the page load, through JavaScript code.


Differences Between HTML 4.01 and HTML5

None.


Differences Between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the checked attribute must be defined as <input checked="checked" />.


Syntax


❮ Ev Onload Att Output Name ❯