<label><input type="radio" name="group1" selected="selected" /> one </label>
<label><input type="radio" name="group1" /> two </label>
<fieldset id="one"> one </fieldset>
<fieldset id="two"> two </fieldset>
I’d like to show one fieldset at a time based on the radio selected. I know how to do with <a>s but radios seem difficult.
Thanks for your help
You can give them a common class, like this:
Then give the radio buttons matching values to the IDs, like this:
Then rig up and
onchangeevent, like this:You can give it a try here, all this does is every time a change happens, hide all the
<fieldset>elements with that class, then show only the one with the corresponding ID.