I am making a ASP.NET 3 MVC project, but it seems i can't make jQuery work properly.
In the view i have something like this:
<a id="login">lala</a>
Then in the .js file:
$("#login").click(function () {
alert("lal");
});
The alert doesn't show on the screen. I've added the reference of my custom .js file in _Layout and updated to the newest library, but whatever I do I can't find any element. What am I doing wrong here :s
$(document).ready()handler? If not, then your event won't work because it's trying to bind it before the DOM finished loading.href="#"attribute, otherwise the link won't appear clickable.