I have lines of code like this:
$(this).parent().parent().children().each(function(){ // do something });
It works well. But I need to run
jQuery will automatically invoke your function with the proper context set.
$('#button').on('click', myFunction); function myFunction() { var that = $(this); console.log(that); }