Link to home
Start Free TrialLog in
Avatar of Victor Kimura
Victor KimuraFlag for Canada

asked on

jQuery: what is $("*", document.body).click(function (event) {...});

Hi,

I saw this in the jquery doc page:
http://api.jquery.com/offset/

Just wondering what is the '*' asterisk, document.body?
What does the second parameter do? Is is a relative DOM?

<script>
$( "*", document.body ).click(function( event ) {
  var offset = $( this ).offset();
  event.stopPropagation();
  $( "#result" ).text( this.tagName +
    " coords ( " + offset.left + ", " + offset.top + " )" );
});
</script>

Open in new window


Much thanks and Father bless<><
ASKER CERTIFIED SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor Kimura

ASKER

I see. Thank you, fellas! That's helpful. =)