Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Webpage Element Information

by Anonymous Monk
on Feb 26, 2008 at 19:04 UTC ( [id://670361]=note: print w/replies, xml ) Need Help??


in reply to Webpage Element Information

This is a bit late to be back to this but I thought of it while playing with something else. I really like the jQuery chaining and the vertical-style notation makes it quite easy to read. stopPropagation() is normalized in jQuery and should work on any modern browser.

<script type="text/javascript" src="/your/path/to/jquery.js"> </script> <script type="text/javascript"> $(function(){ $("*").click(function(evt){ var lineage = $(this) .parents() .get() .reverse() .map(function(n){return n.nodeName.toLowerCase()}) .join(" > "); evt.stopPropagation(); alert(lineage); }); });

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://670361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-25 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found