Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML input checked attribute

HTML checked attribute

HTML input Tag Reference HTML tag

Example

An HTML form with a pre-selected checkbox:

I have a bike

I have a car

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the checked attribute.


Definition and Usage

The checked attribute is a boolean attribute.

The checked attribute specifies that the .

The checked attribute applies to the and .

The checked attribute can also be set via JavaScript code after the page has loaded.


Differences between HTML 4.01 and HTML5

none.


Differences between HTML and XHTML

In XHTML, attribute minimization is forbidden; the checked attribute must be defined as .


Syntax


HTML input Tag Reference HTML tag