do you know how to pre-select a Radio Button in HTML ?
Yes. Set the CHECKED property of the HTML radio button to “checked” in order to make it default to the “selected” state.
For example, the following 3 radio buttons are provided to select the most favorite game, with Super Mario Bros “Checked” ie selected by default.
Super Mario Bros Dangerous Dave PacmanCode Snippet
<input checked="checked" name="super-mario-bros" type="radio" value="super-mario-bros" />Super Mario Bros <input name="dangerous-dave" type="radio" value="dangerous-dave" />Dangerous Dave <input name="pacman" type="radio" value="pacman" />Pacman

One Response on “do you know how to pre-select a Radio Button in HTML ?”
Trackbacks/Pingbacks
[...] Notice how all the 3 radio button declarations have the same name video-game-console-brand. This declaration will rendered the FORM as shown below, with the Nintendo Wii pre-selected. [...]