How to assign an initial value to the radio button as checked with HTML?

Spread the love

Sometimes, we want to assign an initial value to the radio button as checked with HTML.

In this article, we’ll look at how to assign an initial value to the radio button as checked with HTML.

How to assign an initial value to the radio button as checked with HTML?

To assign an initial value to the radio button as checked with HTML, we set the checked attribute.

For instance, we write

<input type="radio" checked="checked" />

to set the checked attribute to checked to make the radio button selected by default.

Conclusion

To assign an initial value to the radio button as checked with HTML, we set the checked attribute.

Leave a Reply

Your email address will not be published. Required fields are marked *