I have dynamically created element
<a class="update-link">
with path: body > div#MySection > table> tbody > tr > td > div > a.update-link
.
When I bind event using
$(document).on("click", ".update-link", fn)
The event is triggered.
When I use $("body")
or $("#MySection")
, the event is not triggered. $(document)
works but is inefficient due to the large scope. Why don't the more specific selectors work?