Answers for "how to select only one checkbox in html"

0

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'>
Posted by: Guest on July-06-2021

Code answers related to "how to select only one checkbox in html"

Browse Popular Code Answers by Language