Use jquery ':contains' to find specific javascript within a span
<p>This is my first time here, I hope that this is clear.</p>

<p>So i will have code similar to this this.</p>

<pre><code> &lt;span class="mediaSource ui-draggable" id="purchsePlay7915504"&gt;
    &lt;a href="" onclick="return popup_window(this, 'MediaView', 850, 680)" class="control"  enter code hereid="GenericLink"&gt;&lt;/a&gt;
    &lt;img id="Any_71" alt="Media Source" src="images/9672web.gif" class="mediaStationIcons mediaWin"/&gt;
    &lt;img class="player" alt="Media Source" src="images/playmedia.gif" style="display: none;"/&gt;
    &lt;/span&gt;  
</code></pre>

<p>The href portion is generated on the backend, and I have no access to it.</p>

<p>I need to modify some existing jquery code to do something based on what the 'onclick' function is(there are different ones e.g. popup_window1,popup_window2 etc.) .</p>

<p>I tried something like this:</p>

<pre><code>$('.segmentLeft span.mediaSource').click(function(){
if ($('span:contains("popup_window")').length &gt; 0) {
 do something
}
});
</code></pre>

<p>but it does not seem to work.</p>
