I have a button which I want to perform a preventdefault, the click function associated with that button does not work for me, to try I have the following:
<script src="../js/jQuery-2.1.4.min.js" type="text/javascript"</script>
<script type="text/javascript">
$(document).ready(function () {
$('#btnGuardar').click(function () {
alert("Es una prueba");
});
});
</script>
and the button
<asp:Button ID="btnGuardar" runat="server" Text="Button" />
It turns out that if I change '#btnSave' for the element "a" IT WORKS for what would be links, then how can it be that simply changing the a for my button does not work? and I think the question may come because my webform is associated with a masterpage, since creating an independent webform I tested the code for the button and it works for me.