javascript - hasClass jQuery isn't working -


I am working on a navigation system where the left and right arrows extend the LIs.

  & lt; a href = "#" square = "icon-arrow-left active" & gt; & Lt; / A & gt; & Lt; Ul & gt; & Lt; Li class = "contracted" & gt; & Lt; A href = "#" & gt; 1 & lt; / A & gt; & Lt; / li & gt; & Lt; li class = "extended" & gt; & Lt; A href = "#" & gt; 2 & lt; / A & gt; & Lt; / li & gt; & Lt; li class = "active placement" & gt; & Lt; A href = "#" & gt; 3 & lt; / A & gt; & Lt; / li & gt; & Lt; li class = "extended" & gt; & Lt; A href = "#" & gt; 4 & lt; / A & gt; & Lt; / li & gt; & Lt; Li class = "contracted" & gt; & Lt; A href = "#" & gt; 5 & ​​lt; / A & gt; & Lt; / li & gt; & Lt; / Ul & gt; & Lt; A href = "#" square = "icon icon-arrow-right active" & gt; & Lt; / A & gt; When the fist is 'extended', 'icon-arrow-left' should be 'inactive' and when the last le 'extended' icon should be 'icon-arrow-correct'.  

I tried to use it, but not working

  if ($ ('li: first-child'). Haclas ('active placement')) { $ ('Atre (' square ',' inactivated ')}   

is

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -