Reputation: 4076
using prototype, I am trying to hide the specific children element of a particular element.
From the html below, I want to hide child ul
and all of its element:
<ul>
<li id="category_1" class="active">
<strong id="img_1" class="cat_plus"></strong>
<input type="checkbox" name="cat_id[]" value="1">
<ul>
<li id="category_3">
<strong id="img_1" class="cat_plus"></strong>
<input type="checkbox" name="cat_id[]" value="3">Root Catalog
</li>
</ul>
<li>
</ul>
i tried:
$('category_1 ul').hide();
Upvotes: 2
Views: 213
Reputation: 8987
I think this is what you are looking for.
$$('#category_1 ul').first().hide();
I hope it helps.
Upvotes: 2