Target a link if that link links to the current page?
<p>this may be a stupid question as I can't seem to find an answer :P</p>

<p>Is there a way with javascript/jQuery to Target all links on a page ONLY if they link to the current page?</p>

<p>Say i've got a static sidebar on ALL pages, for intents and purposes:</p>

<pre><code>&lt;ul id="sidebar"&gt;
    &lt;li&gt;&lt;a href="/one"&gt;One&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/two"&gt;Two&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/three"&gt;Three&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>Notice the code for ALL of them is the same. Let's say I'm on "www.domain.com/two" - Is there a way to target </p>

<pre><code>&lt;li&gt;&lt;a href="#"&gt;Two&lt;/a&gt;&lt;/li&gt;
</code></pre>

<p>because it's linking to the current page?</p>

<p><em><strong></em>***</strong><em>ANSWERED</em><strong><em>*</em>**<em>*</em>*</strong></p>

<p>The guy deleted his answer - but I used it to create this -</p>

<pre><code>var linksToCurrentPage = $('a[href="' + window.location.href + '"]');
if (linksToCurrentPage) {
    $('a').addClass('currently-active');
};
</code></pre>

<p>which worked :)</p>
