jQuery: how do I check if an element attribute contains part of a string?
<p>Like, I want to check if a link has a certain domain, or already has parameters attached to the end.</p>

<p>is there a way of doing a regex thing like ~= maybe?</p>

<p>currently, I have </p>

<pre><code>    alert(ref);
        $j("a[href*='mysite']").each(function(i){
            alert("hello");
            $j(this).attr('href',$j(this).attr('href') + "?ref=" + $j.cookie.get("tb_ref"));
        }); 
</code></pre>

<p>but the selector isn't working. (I never see the <code>Hello</code> alert, but I seed the <code>alert ref</code> alert.</p>

<p>my a tags</p>

<pre><code>&lt;a href="http://domain.mysite.com/"&gt;yeah, link&lt;/a&gt;
&lt;a href="http://google.com/"&gt;g, link&lt;/a&gt;
</code></pre>
