I have the following code snippet
<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script> $('body').on('click', 'a.wishlist_item', function(){ alert('asas'); return false; }) </script> </head> <body> <a class="wishlist_item" id="wishlist_item" href="#" >Add to wishlist</a> </body> </html>
The code should be warned when I click on the hyperlink with the wishlist_item class. but its not working .. is there something i can do wrong in this code?
source share