2

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();
0

1 Answer 1

2

I think this is what you are looking for.

$$('#category_1 ul').first().hide();

See fiddle

I hope it helps.

Sign up to request clarification or add additional context in comments.

1 Comment

TypeError: $$(...).first(...) is undefined

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.