I have recently converted my code into an asp.net format but am getting an this Uncaught TypeError with one of my JS functions. I have tested and it works when its not in the asp.net format.
The error comes when i interact with a button that i supposed to close a message. I have double checked syntax but still cant find the error.
This is the button -
<div id="main_modal" class="modal">
<button type="button" value="Exit Modal" id="exit_modal" onclick="exit_modal()">X</button>
</div>
This is the function it calls onclick -
function exit_modal(){
document.getElementById("main_modal").style.visibility = "hidden";
}
This is the error received in Chrome dev tools when button is clicked -
Uncaught TypeError: exit_modal is not a function at HTMLButtonElement.onclick
I am new to using asp.net so any help would be very appreciated. Thanks in advance.