VOOZH about

URL: https://www.geeksforgeeks.org/html/html-inputchecked-attribute/

⇱ HTML <input>checked Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <input>checked Attribute

Last Updated : 25 May, 2026

The checked attribute is used to preselect a checkbox or radio button when a webpage loads. It helps in setting default choices in forms.

  • Automatically selects a checkbox or radio button by default.
  • Mainly used with <input type="checkbox"> and <input type="radio">.
  • It is a boolean attribute, so its presence alone makes the input checked.

Syntax:

<input type = "checkbox|radio" checked> 

Example: The first checkbox is checked by default using checked, while the second checkbox is unchecked by default.

Comment
Article Tags: