How to click on button and pop up alert message using jQuery

wypcchassis

New Member
I am unable to get the alert message to pop up. I have all the other jQuery code working, so I know I linked the library correctly. Could it be where I put it in the document that matters?HTML:\[code\]<button type="button" class="cancelForm">Cancel</button> \[/code\]jQuery:\[code\] $(".cancelForm").submit(function(){ alert('Are you sure you want to cancel?'); });\[/code\]UPDATE: Still couldn't get it to work. I wil try relabeling later. Thanks for the tips.\[code\]$(".cancelForm").on('click', function(){alert('Are you sure you want to cancel?');});\[/code\]
 
Back
Top