javascript - filter array of list into sub array in jquery -
i stuck @ code, have array of li's element , want array contains li ist array has classname hide. here trying
<div id="videoarea "> <ul> <li class="hide">a</li> <li class="hide">a</li> <li class="hide">a</li> <li >a</li> <li >a</li> <li >a</li> </ul> <ul> <li class="hide">b</li> <li class="hide">b</li> <li class="hide">b</li> <li >b</li> <li >b</li> <li >b</li> </ul> </div> var items = $("#videoarea div ul"); var templi = items.eq(1).children().hasclass("hide"); // showing true, want array of li's having class hide
i want array contains li's of particular ul having class hide , if possible array dont have class hide
for li
elements .hide
, connect them in selector.
for li
elements without .hide
, use :not()
var items = $("#videoarea div ul"); var liwithhide = items.eq(1).children("li.hide"); var liwithouthide = items.eq(1).children("li:not(.hide)");
Comments
Post a Comment