Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Webpage Element Information

by Anonymous Monk
on Feb 26, 2008 at 19:04 UTC ( #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
Node Status?
node history
Node Type: note [id://670361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2020-11-25 02:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?