<input id="Checkbox1" type="checkbox" /> <input id="Checkbox2" type="checkbox" /> <label id="checktext"></label>
function gettext(a, b) { var x = document.getElementById(a); var y = document.getElementById(b); if (x.checked) return x.textContent; else if (y.checked) return y.textContent; }
You've got single-equals instead of double-equals in your if statements: if (checkbox.checked=true) { should be if (checkbox.checked == true) { or just if (checkbox.checked) {
if (x.checked)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)