HTML <input> checked Attribute
HTML <input> tag
Example
An HTML form with a preselected checkbox:
<form
action="form_action.asp"
method="get">
<input type="checkbox" name="vehicle" value="Car" checked="checked" /> I have a car <br />
</form> |
Try it yourself »
|
Definition and Usage
The checked attribute specifies that an input element should be preselected when the page loads.
The checked attribute is used with <input type="checkbox"> or
<input type="radio">.
The checked attribute can also be set after the page load, with a JavaScript.
Browser Support

The checked attribute is supported in all major browsers.
Syntax
| <input checked="value" /> |
Attribute Values
| Value |
Description |
| checked |
Preselects the checkbox or radio button |
HTML <input> tag
Start Creating a stunning, Flash website. It's easy and free!
Wix.com offers you a simple, powerful, drag & drop editing platform to create stunning Flash websites, layouts, and more.
With added e-commerce features such as search engine visibility and professional tools, Wix is the ultimate solution for creating a spectacular site.
 |
W3Schools' Online Certification
The perfect solution for professionals who need to balance work, family, and career building.
More than 6000 certificates already issued!
Get Your Certificate »
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|