I want a radio button to be automatically selected every time it is open in the screen. so that the user will no longer click it. what attribute will i use?
<input type="radio" name="sex" value="male">Choose<br>
I want a radio button to be automatically selected every time it is open in the screen. so that the user will no longer click it. what attribute will i use?
<input type="radio" name="sex" value="male">Choose<br>
Add checked
<input type="radio" name="sex" value="male" checked>Choose<br>
To hide the radio button use below css:
input[type="radio"]:checked{
visibility:hidden;
}
checked attribute used to set your radio button or checked box to pre-selected state while page is loaded.
<input type="radio" name="sex" value="male" checked>Choose</br>
<input type="radio" name="sex" value="male" checked>Male</br>
<input type="radio" name="sex" value="female">Female</br>
Click Here for the working example on jsFiddle.
Hope this helps