HTML input checked Attribute Tutorial

In this section, we will learn what the checked attribute is and how to use it.

What is checked Attribute in HTML <input> Tag?

The checked attribute is used with <input> elements of type radio or checkbox.

When applied, the target <input> element becomes checked (pre-selected) by default when the page is loaded.

HTML checked Attribute in <input> Tag Syntax:

<input type = “radio | checkbox” checked>

<input> Tag checked Attribute Values

The checked attribute is a Boolean attribute and that means it doesn’t take any value.

Example: using checked attribute in HTML <input> tag

See the Pen using checked attribute in HTML <input> tag by Omid Dehghan (@odehghan) on CodePen.


Top Technologies