I am new to html and Jquery I am trying to create a project where in first I disable my Jquery Button first but when checkbox clicked it will be enabled however my code below is not working. The button is not disable always enable even my checkbox is uncheck. I would really appreciate any suggestion and help. Thanks a lot.
function goFurther() {
if (document.getElementById("chkAgree").checked == true) {
$("#submit").disabled = false;
$("#cancel").disabled = false;
} else {
$("#submit").disabled = true;
$("#cancel").disabled = true;
}
}
input[disabled] {
color: gray;
text-decoration: none;
}
<form>
<input type="checkbox" id="chkAgree" onclick="goFurther()">I agree.
<br><br>
</form>