How do I detect in jQuery if the contents of an anchor tag contains a string?
<p>How can i check <code>&lt;a href="#"&gt;sometext&lt;/a&gt;</code> equals something, trying to reach something like this:</p>

<pre><code>$('a').click(function() {
    if ($("a:contains('sometext')")) {
        alert('sometext');
    }
    else {
        alert('text');  
    }
});
</code></pre>
