0

Hi Editor: this is not a question about: .on('click') vs .click

HTML:

<div id="menu">
    <div id="someID">
        <a href="#">click</a>
    </div>
</div>

jQuery was working, not sure why not working now

$('#menu a').on('click', function(){ alert(8); });

It took me a while to figure out the following is now working, but still not sure why:

$('#menu').on('click', 'a', function(){ alert(8); });
SIDU
  • 2,258
  • 1
  • 12
  • 23

0 Answers0