I have a disabled input button, that will get enabled when checking a checkbox.
Now, what I want is that the button shows an alert when it is clicked while is disabled to inform the user that he needs to check the checkbox first.
<input type="submit" disabled="disabled" id="proceedButton">
When I click the button nothing happens because it is disabled
$("input#proceedButton").click(function() {
if (!$("input#acceptCheckbox").is(':checked')) {
alert("show me");
}
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…