Trying To Perform .has() with .attr() to style more
<p>I am trying to use an <code>if</code> <code>else if</code> statements for my jQuery to add multiple statements so that it is neatly done. Only problem is one I am getting a console error and two it of course is not working ugh!</p>

<p>Code</p>

<pre><code>$(document).ready(function() { 
 var NLG = $('.post .name strong a').has('span'); 
if {
   NLG.attr('style','color:#09B300').css({'font-weight':'bold'});
   }
 else if {
     NLG.attr('style','color:#09B400').css({'text-decoration':'underline'});
         }
});
</code></pre>

<p>I don't know if I wrote the <code>.attr</code> correctly or even the <code>.has()</code></p>

<p>I am going to have alot more else if statements and well hope you understand what I want done here. Basically search for if the span as a style with the color base and if so had some more CSS to it.</p>

<p>Thanks to demwunz I have got the problem fixed, and understanding the if conditions a wee bit more thanks everyone!</p>

<pre><code>$(document).ready(function() { 
    var NLG = $('.post .name a span');
    var color = NLG.attr('style');
 if(color === 'color:#09B300'){
    NLG.addClass('bringingback');
    } 
  else if (color === 'color:#09B400'){
    NLG.addClass('takenback');
        }
});
</code></pre>
