I am trying to get the li tag from a ul element and then hide them but when i call the hide function I get Object # has no method 'hide'
var li = $(this).siblings("ul").children("li");
li.get(0).hide ();
I think that the problem is that I can't call regular jquery method unless its a object if so how can I get the object and not or if not how do I call methods form
I am trying to get the li tag from a ul element and then hide them but when i call the hide function I get Object # has no method 'hide'
var li = $(this).siblings("ul").children("li");
li.get(0).hide ();
I think that the problem is that I can't call regular jquery method unless its a object if so how can I get the object and not or if not how do I call methods form
Share Improve this question asked Feb 12, 2013 at 20:14 user2054833user2054833 2,1657 gold badges25 silver badges41 bronze badges1 Answer
Reset to default 10.get(0)
returns the native element.
To hide the first element, use .eq()
instead:
li.eq(0).hide();