خوب بخاطر اینه که این کد دقیقا تگ بعدی رو فعال یا غیر فعال می کنه
این کد کاملتر هست
کد HTML:
<html>
<head>
<title>Checkbox</title>
<script>
function checkIt(el)
{
var btn = el.nextSibling;
while(btn.nodeType != 'INPUT' && btn.type != 'button')
{
btn = btn.nextSibling;
}
if(el.checked)
btn.disabled = false;
else
btn.disabled = true;
}
</script>
</head>
<body>
<form>
چک باکس ۱<input type="checkbox" onclick="checkIt(this)" /><input type="button" value="دکمه ۱" disabled="true" onclick="location.href='http://yourlink'" />
<br>
چک باکس ۲<input type="checkbox" onclick="checkIt(this)" /><input type="button" value="دکمه ۲" disabled="true" onclick="location.href='http://yourlink'" />
<br>
چک باکس ۳<input type="checkbox" onclick="checkIt(this)" /><input type="button" value="دکمه ۳" disabled="true" onclick="location.href='http://yourlink'" />
</form>
</body>
</html>