Find a link whose href matches
<p>I have a link like:</p>

<p><code>&lt;a href="#slide1"&gt;Slide 1&lt;/a&gt;</code></p>

<p>And I want to find it like so:</p>

<p><code>$('ul.dots li a').attr('href').is('#' + id).parents('li').toggleClass('selected');</code></p>

<p>the id variable would be something like: <code>#slide1</code> including the hash. However it does not work... Any ideas on how best to do this? I also tried: <code>$('ul.dots li a[href=#' + id + ']').parents('li').toggleClass('selected');</code> but doesn't work either...</p>

<p>Can anyone help. Thanks</p>
