I'm trying to develop an application in ASP.Net MVC5. I have written some JQuery functions in my Razor page. I want to take those JQuery functions to an external JS file and include it to the .cshtml page. this is how I referred the Js file in .cshtml file
<script src="~/Js/Driver.js"></script>
If I write alert("External JS file loaded successfully");
in my Driver.js
file, the message box is popped up successfully. But if I write this function
$("#btnCreate").click(function () {
alert("Create button clicked");});
in that file, it shows below error in console.
how to fix this?