Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

how to select only one checkbox in html

It's easier to use type='radio' with the same value at 'name' attribute.

The selected value is the value that the 'variable' input_name has.

You can parse the selected value by name. Like: document.getElementsByName('input_name')

<input name='input_name' type='radio'>
<input name='input_name' type='radio'>
<input name='input_name' type='radio'>
<input name='input_name' type='radio'>
<input name='input_name' type='radio'>
 
PREVIOUS NEXT
Tagged: #select #checkbox #html
ADD COMMENT
Topic
Name
4+8 =