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.