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
Post a Comment