I am trying to get alert on click event of a tag, but it seems to be not working. Here is the code.
I put this in header.php

<script>
jQuery(function() {

  jQuery('.neha').click(function () {
 var addressValue = $(this).attr("href");
        alert(addressValue );
  })

});
</script>

and HTML code is

neha

I added this but nothing is appear. Please help me out

Read more here: onclick jquery function not working in wordpress header file


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: