0

I am trying to call a function when the user clicks on the first item on an unordered list. But it does not seem to work.

This is what I did:

$('#listResults li').first().on('click', function() {
    console.log('clicked');                         
});
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user3312508
  • 907
  • 4
  • 10
  • 25
  • 1
    Dynamically created content? – Musa Aug 21 '14 at 21:28
  • @Musa Yes dynamically – user3312508 Aug 21 '14 at 21:32