I have a button on one of my views
<div class="span12">
<button id="saveButton" class="btn"><i class="icon-download-alt green"></i> Save</button>
</div>
and a JQuery click event
$("#saveButton").click(function () {
alert("Save clicked");
});
For some reason the click event is never triggered. If I place an alert before the JQuery event the alert is triggered successfully.
I'm sure I'm missing something really simple here, but I cant seem to find the problem.
I made sure that
- JQuery is included successfully
- The javascript file is included successfully
- I use the correct Id for the control
Is there any reason why this event is not triggered?
.on()function.