$("body").on('click', 'ul#ajax-users-list>li', () => {
console.log( $(this).data('id') );
});
This code returning undefined, because $(this) = [Window].
How can i access data attributes for element, that triggered click event?
$("body").on('click', 'ul#ajax-users-list>li', () => {
console.log( $(this).data('id') );
});
This code returning undefined, because $(this) = [Window].
How can i access data attributes for element, that triggered click event?