I've looked at a fair few suggestions and similar questions to this but the solutions haven't worked thus far. Originally I tried to use a button to activate a Web API I was using however the button itself wouldn't trigger. Then I realised it wasn't the API that wasn't working, it's the button. I've tried to rewrite the button to be much simpler just for the sake of seeing if it works and still no result. The code looks like this:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#TestButton").click(function () {
alert("Hello World")
});
}
</script>
<button id="TestButton"> Click here for test </button>
When I click the button the alert doesn't activate and I don't know why. It may be worth mentioning that I've written this on an .aspx page but I've not used any asp.net syntax.
.ready()function.