Check if class is present w/jQuery
<p>Is it possible to check if a certain class is present in an element and if yes, create a variable for my function? </p>

<pre><code>&lt;a href="#" id="clickMe"&gt;&lt;span class="A open"&gt;&lt;/span&gt;link&lt;/a&gt;
</code></pre>

<p>For example if class open is present I will create a varialbe "close".</p>

<pre><code>$(function ()
{
    $('#clickMe').click(function ()
    {
        // if "open"
        var myVar = 'close';
        // else 
        var myVar = 'open';
    });
});
</code></pre>
