jQuery Javascript removing attribute from filtered item
<p>I have a treeview menu with variable levels. Only element on last level is clickable, the rest should have links "#". By default level 2 and 3 have links (links are created dynamically so I can't add them by jQ). If li level is 3, I need to change href for level 2 to "#" but I can't get it working :/</p>

<pre><code>&lt;ul id="Menu"&gt;
&lt;li&gt;
    &lt;span id="primary"&gt;
        &lt;h1&gt;
            &lt;a href="#"&gt;Torby&lt;/a&gt;
        &lt;/h1&gt;
    &lt;/span&gt;
    &lt;ul&gt;
        &lt;li&gt;
            &lt;span id="secondary"&gt;
                &lt;h2&gt;
                    &lt;a href="/category/category/bags_/"&gt;Torby&lt;/a&gt;
                &lt;/h2&gt;
            &lt;/span&gt;
            &lt;ul&gt;
                &lt;li&gt;
                    &lt;h3&gt;
                        &lt;a href="/category/category/shoulderbag/"&gt;Na Ramię&lt;/a&gt;
                    &lt;/h3&gt;
                &lt;/li&gt;
            &lt;/ul&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/li&gt;
</code></pre>

<p></p>

<p>h2 href is what I'm after . I've tried sth like this :</p>

<pre><code>$("Menu ul").has("h3"){
    $(this).find("#secondary h2 a").attr("href","#");
};
</code></pre>

<p>This is how it looks :</p>

<p><a href="http://img707.imageshack.us/img707/2855/menule.jpg" rel="nofollow">http://img707.imageshack.us/img707/2855/menule.jpg</a></p>
