Home » , » Creating a Radio or Checkbox HTML Form

Creating a Radio or Checkbox HTML Form

The INPUT tag is used to create input fields within a web page form.

You can create a radio or checkbox selection list by adding attributes to your INPUT tag.
<INPUT type="radio" name="your_selection" value="Option 1">Option 1
<INPUT type="radio" name="your_selection" value="Option 2">Option 2
<INPUT type="radio" name="your_selection" value="Option 3">Option 3
Browser View:
Option 1
Option 2
Option 3
<INPUT type="checkbox" name="selection">Selection 1
<INPUT type="checkbox" name="selection">Selection 2
<INPUT type="checkbox" name="selection">Selection 3
Browser View:
Selection 1
Selection 2
Selection 3
You can select a default value by adding the word "checked" within your INPUT tag.
<INPUT type="radio" name="option" checked>Option 1
<INPUT type="checkbox" name="selection" checked>Selection 1
Browser View:
Option 1
Selection 1
Share this article :


Post a Comment

Copyright © Online Business - All Rights Reserved
Proudly powered by Blogger