I have JQuery included and all my other click functions work. I have tried to debug and change it from class to ID and both the class and ID name is unique (no other element uses the class or ID).
<button type="button" style="margin-left: 5px; padding: 7px;" class="btn query-btn"> Search Transactions </button>
Here is my code for the HTML and my JQuery is:
$(".query-btn").click(function () {
alert("gets here");
});
I literally have no idea why this isn't working because it works on everything else. Could anyone possibly point me the right direction? I have tried giving it an ID (unique) and changing the .
to a #
and that does not work either and yes it is wrapped in a:
$(document).ready(function () {
I receive no errors which is what is sort of confusing me. Anything would be appreciated!
Note: The HTML button is actually added by AJAX (A button is pressed and the response is directly inserted using the innerHTML
), not default page load. I'm not sure if this would effect it but just a note incase it does.