Reputation: 43
i have chosen some of div elements in HTML and save them in an array
var Div = $(".etc") ;
i want to use this notation to slide-toggle Div elements with this code ;
Div[0].slideToggle(...) ;
but it doesn't work and doesn't toggle the element . although i try to alert element's value or name and other attributes but it doesn't work.
Upvotes: 0
Views: 52
Reputation: 437336
The bracket notation returns DOM elements, which do not have a slideToggle
method. What you want is .eq
, which filters in the same manner but returns jQuery objects instead:
Div.eq(0).slideToggle(...) ;
Upvotes: 4