jquery - How to get selector on which 'click' event has been bound? -
i'm using jquery on
function bind click event:
$('#page-container, .some-class').on('click', '.do-something', function(event) { // #page-container or .some-class? });
now inside callback function want know if 'click' event has been fired #page-container
or .some-class
. $(this)
selector has been clicked.
delagatetarget
property of event
object refers target of delegation:
$('#page-container, .some-class').on('click', '.do-something', function(event) { var dt = event.delegatetarget; });
Comments
Post a Comment