I have 3 checkbox, for which I want only 1 checkbox to be checked at a time. below is my fiddle for the html
3
1
JS fiddle
I want this to b
function selectOnlyThis(id) { for (var i = 1;i <= 4; i++) { document.getElementById(i).checked = false; } document.getElementById(id).checked = true; }
Option 1 Option 2 Option 3 Option 4
It should help you