Alexander  Tolkachev Alexander Tolkachev - 5 months ago 8
Javascript Question

Javascript a tag onclick doesn't work

I want to excecute a onclick event. But when i click it - nothing shows. How to set correct on click listner for a link with js?



$('a#askCall').click(function(){
alert("!");
});

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<a id="askCall">Call me maybe</a>





UPDATE:



Okay, but correct variant does not wotk for me too..

Answer

$('a#askCall').click(function() {
  alert("!");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<a id="askCall">Call me maybe</a>

Comments