jQuery select last span from h1
<p>How can I select last span from h1 element?</p>

<pre><code>&lt;h1&gt;
    &lt;a href="#"&gt;
        &lt;span&gt;Stackoverflow&lt;/span&gt;
        &lt;span&gt;This is the text what I want to hide&lt;/span&gt;
        &lt;img src="gif.gif"&gt;
    &lt;/a&gt;
&lt;/h1&gt;
</code></pre>

<p>What I have tried, but not working:</p>

<pre><code>$("h1").each(function() {
    $(this).last("span").hide();  
});
</code></pre>
