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 ansver and 2 for the no ansver. If u dont understand my horrible english take a look on my page. The chceckboxes are in down-right corner. If u want to see on page here is the link: Visit http://ift.tt/1AoBygO
thas my HTML:
<div id="form">
<div class="anketa">
<h3>Pači sa Vám táto stránka?</h3>
<div class="checkbox custom">
<input id="box" class="css-checkbox" type="checkbox" name="boxes" />
<label for="box" class="css-label" name="yes" onclick="" ></label> Áno
</div>
<div class="checkbox custom">
<input id="box1" class="css-checkbox" type="checkbox" name="boxes" />
<label for="box1" class="css-label" name="no" onclick="" ></label> Nie
</div>
</div>
<div class="anketa">
<h3>Pomohla Vám táto stránka?</h3>
<div class="checkbox custom">
<input id="box2" class="css-checkbox" type="checkbox" name="boxes" />
<label for="box2" class="css-label" name="yes" onclick=""></label>Áno
</div>
<div class="checkbox custom">
<input id="box3" class="css-checkbox" type="checkbox" name="boxes" />
<label for="box3" class="css-label" name="no" onclick=""></label> Nie
</div>
</div>
</div>
And this is my script:
var checkbox = document.getElementByClassName("css-checkbox");
//?
}
Thanks for every help.
Aucun commentaire:
Enregistrer un commentaire