Siblings are tags who have the same parent. For example:
foobar.../barfar.../far/foowax.../wax
bar and far are siblings, foo and wax are siblings, far and wax aren't
siblings.
Maybe try this:
$('.collapse_device').click(function() {
$(this).parents('.device_header').next().hide();
});
That
Hi Jody,
The .next() method only works for *sibling* elements. Let's take a
look at your HTML again, but with another element added and with some
indentation:
div class=device_header
h2Device Name/h2
ul
li
span
You'll need to do something along the lines of:
$('a.collapse_device').click(function() {
$(this). // this gets the a.collapse_device itself
parent(). // this gets the span
parent(). // this gets the li
parent(). // this gets the ul
parent(). // this gets the div.device_header
3 matches
Mail list logo