|
|
HTML Forms - Radio Button
Radio Buttons
Radio buttons are like checkboxes, except you can only select one item from a list of items with the same
name="" attribute. You can also use checked="" attribute to set one of the radio buttons as preselected. As you can see in this example, you can have multiple radio buttons in a form with different names, and those with the same name will be exclusive of those with different names:<input type="radio" name="code" />HTML <br /> <input type="radio" name="code" />CSS <br /> <input type="radio" name="code" />PHP <br /> <input type="radio" name="code" />JavaScript <br /> <br /> <input type="radio" name="gender" />Male <br /> <input type="radio" name="gender" />Female <br /> <br /> <input type="radio" name="age" />Under 18 <br /> <input type="radio" name="age" checked="yes" />18 - 30 <br /> <input type="radio" name="age" />30 - 50 <br /> <input type="radio" name="age" />50 - 70 <br /> <input type="radio" name="age" />70+ <br />
HTML
CSS PHP JavaScript Male Female Under 18 18 - 30 30 - 50 50 - 70 70+ Page Responses
Currently there have been no responses to this page...
If you have anything to contribute to this tutorial, found a bug, or know a better way of achieving the same goal, please leave your response below.
|