I was just wondering which way is more efficient or if there is any difference in the cost of this operation:
A) $(document).on('click', '#lol', function(){alert('hello')})
vs
B) $('#lol').on('click', function(){alert('hello')})
I know the latter won't work if the element with ID 'lol' gets appended to the DOM after the ready function is executed. I've just sort of adopted using implementation A everywhere just as best practice since it keeps all the event code the same regardless of the element I'm targeting. So I'm wondering is there a downside to using option A all the time?