What is HTML checked Attribute?

HTML, HTML Attributes , 0 Comments

The checked attribute is a boolean attribute and it specifies that an element should be pre-selected (checked) when the page loads.

Tip: you can also set checked attribute after page load with using JavaScript.

Tag Support

You can use checked attribute with <input> tag where input type is checkbox or radio.

Example

<form>
    <input type="checkbox" name="check" value="1" checked> 
  		Checked by default
  	<br> 
    <input type="checkbox" name="check" value="2"> 
  		Not checked by default 
</form> 

Browser Support

Attribute
checked1.02.01.01.01.0

Spread the love

Leave a Reply

avatar
  Subscribe  
Notify of