Wednesday, May 16, 2012

Radiobuttons

This element allows our user to select from a series of options,with a selection-circle in front of it.By selecting an option, one that already was chosen get's deselected.The tag for radio buttons is:
<input type="radio" name="option" value="" />
In order to create a selection list, all the elements in it must have the same name and different values.
Radio buttons also have the attributes name, id, value and checked, which I explained in previous posts.
Example of a simple selection list:

 Favorite color: <br/>


Red<input type="radio" name="option" value="red" /><br/>
Blue<input type="radio" name="option" value="blue" /><br/>
Green<input type="radio" name="option" value="Green" /><br/>

Favorite color:
Red
Blue
Green

No comments:

Post a Comment