Fiddle: http://jsfiddle.net/ugzux/
As you can see, I have a form with a disabled (via javascript) submit button.
I want to be able to bind a click event to
I have a slight more complicate but similar use case to you:
Using jQuery, I have done it with Overlapping the button with a div, and wrapping the div instead another div
See the below demo
var toggleNeedConsent = function() {
var isEnableCheckbox = $('#consent-confirm-checkbox').prop('checked');
$('.needConsentButton').prop('disabled', !isEnableCheckbox);
if (!isEnableCheckbox) {
if (!$(".needConsentButtonOutterDiv").length) {
$('.needConsentButton').wrap("");
}
$('.needConsentButton').after('
Click consent checkbox before approve!
Good things about this approach: