I have weird problem. At first I didn't want to use .on() method because I couldn't get it to work at all, so I used .live().
Now, I'm writing a new jQuery script and I used .on() heavily and it works. Until now.
jQuery code:
$('#artistList a').on('click',function(e){
console.log($(this).parent().text());
e.preventDefault();
});
HTML Code:
<div id="artistList">
<div class="artist"><a class="delete" href="#"></a>Psy</div>
<div class="artist"><a class="delete" href="#"></a>Fernanda Martins</div>
<div class="artist"><a class="delete" href="#"></a>DJ Nreal</div>
</div>
Also tried this methods:
$('#artistList>a').on('click',function(e){
$('.delete').on('click',function(e){
No luck. What am I missing?
This is the only part that doesn't work
I have read the documentation about .on() and based on that, this should work. Also, I'm using the latest jQuery, (jquery-1.8.3.min.js).
EDIT
<a>
elements have a width: 15px
and height: 15px
in CSS, so they are visible.