User81789783 posted
<div id="treetopic"><div class="glyphicon glyphicon-plus" id="div_one">one<div class="treetopicheader" id="div_onetopic" one=""><span>topic one</span></div></div><p></p><div class="glyphicon glyphicon-plus" id="div_two">two<div class="treetopicheader" id="div_twoone" of="" two=""><span>one of two</span></div><div class="treetopicheader" id="div_twotwo" of="" two=""><span>two of two</span></div></div><p></p><div class="glyphicon glyphicon-plus" id="div_three">three</div><p></p></div>
i have above code and i want when user click on glyphicon-plus class i.e plus icon it should hide all child div in it .. for example one has single child in above code and two has two child
i write below code
$(".glyphicon-plus").click(function () {
// alert()
$(".glyphicon-plus").nextUntil("div", "p").hide();
// $(ele).append('<span>' +" "+ $(ele).nextUntil("div.header").filter("p").length +'</span' )
//$(ele).append('<span>' + " " + $(ele).nextUntil("div.header").filter("p").length + '</span')
})