I used two forms in a single page but when I click on checkbox then both submit buttons are active but both are different.
I want to click on form one checkbox then the only form one submit button active and then I click on form two checkbox then the only form two submit button active.
var checkboxes = $("input[type='checkbox']"),
submitButt = $("input[type='submit']");
checkboxes.click(function() {
submitButt.attr("disabled", !checkboxes.is(":checked"));
});
<h1>form one</h1>
<form>
<div>
<input type="checkbox" name="option-1" id="option-1"> <label for="option-1">Option 1</label>
</div>
<div>
<input type="submit" value="Do thing" disabled>
</div>
</form>
<h1>form two</h1>
<form>
<div>
<input type="checkbox" name="option-1" id="option-1"> <label for="option-1">Option 1</label>
</div>
<div>
<input type="submit" value="Do thing" disabled>
</div>
</form>