Disable all checkboxes when one active <p>My problem is that i dont know which element i should target to check if the checkbox is checked and then to disable the other ones. Do i need put this code inside the form tag? In my code i have 2x2 checkboxes 2 for the yes answer and 2 for the no answer.</p> <p>thas my HTML:</p> <pre><code>&lt;div id="form"&gt; &lt;div class="anketa"&gt; &lt;h3&gt;Pači sa Vám táto stránka?&lt;/h3&gt; &lt;div class="checkbox custom"&gt; &lt;input id="box" class="css-checkbox" type="checkbox" name="boxes" /&gt; &lt;label for="box" class="css-label" name="yes" onclick="" &gt;&lt;/label&gt; Áno &lt;/div&gt; &lt;div class="checkbox custom"&gt; &lt;input id="box1" class="css-checkbox" type="checkbox" name="boxes" /&gt; &lt;label for="box1" class="css-label" name="no" onclick="" &gt;&lt;/label&gt; Nie &lt;/div&gt; &lt;/div&gt; &lt;div class="anketa"&gt; &lt;h3&gt;Pomohla Vám táto stránka?&lt;/h3&gt; &lt;div class="checkbox custom"&gt; &lt;input id="box2" class="css-checkbox" type="checkbox" name="boxes" /&gt; &lt;label for="box2" class="css-label" name="yes" onclick=""&gt;&lt;/label&gt;Áno &lt;/div&gt; &lt;div class="checkbox custom"&gt; &lt;input id="box3" class="css-checkbox" type="checkbox" name="boxes" /&gt; &lt;label for="box3" class="css-label" name="no" onclick=""&gt;&lt;/label&gt; Nie &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And this is my script:</p> <pre><code>var checkbox = document.getElementByClassName("css-checkbox"); //? } </code></pre> <p>Thanks for every help.</p>