I am trying to disable a submit button after the first click on a VisualForce page. I would think the code I am using should work, but it is not. I am able to click on the button multiple times. Could anyone help me identify where the issue is?
<script type="text/javascript">
$('button[id$=submitButton]').on('click', function(){
$('button[id$=submitButton]').attr("disabled", true);
});
</script>
<apex:commandLink id="submitButton" value="{!$Label.Disaster_Submit}" action="{!saveConsent}" styleClass="btn btn-fill btn-danger btn-wd btn-sm"></apex:commandLink>