HTML tag selector in jQuery
<p>This question is a bit open ended as I'm not sure it's possible or where to start with it.</p>

<p>If you are familiar with the Web Developer Toolbar for Firefox you will know the CSS > View Style Information tool where you can mouse around a web page and it will select the <code>&lt;h1&gt;</code>, <code>&lt;div&gt;</code> or whatever html tag you are hovering over.</p>

<p>I'd like to recreate this in with jQuery if possible. Hovering over a part of a web page will return the current HTML tag as $(this).</p>

<p>Where do I start? Is this possible?</p>

<p>I want to do this in order to assign custom CSS to it, in order to display it later. e.g</p>

<pre><code>&lt;p class="somename"&gt;kjsadhsfdj  jhfdhj&lt;/p&gt;
</code></pre>

<hr>

<p>thanks for the great answers below, not sure which to mark as correct as they are all good!</p>

<p>started with this:</p>

<pre><code>$(document).ready(
    function() {
        $("*").hover(
            function(obj)
            {
                $(this).css("border","1px solid red");
                $(this).click(
                    function()
                    {
                        console.log($(this));
                    }
                );
            },
            function(obj)
            {
                $(this).css("border","0");
            }
        )
    }
);
</code></pre>

<p>but it's also selecting all of the parent tags...</p>
