jquery - how do I filter an array in coffeescript -


i have bunch of li elements , i'd find 1 specific value. e.g.

<li class="nav"><span>one</span><li> <li class="nav"><span>two</span><li> <li class="nav"><span>three</span><li> 

how find the 1 span text 2 , add class parent li element? got far as

$('li.nav').filter() -> 

i updated https://jsfiddle.net/gadgetgirl/grdkupaz/. got working with

$('li.nav span').filter((i,elem) -> elem.innerhtml "two").closest("a").addclass "my-class-name" 

thanks getting me started.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -