jquery: how to select all other elements?
say i have an e.target
how can i select all other similar e.target elements ?
for instance, e.target would be a link inside a div.
how can i automaticall开发者_Go百科y select all links inside this div ?
is there a function that does this ?
The siblings()
call will find all siblings of each item in the set and won't include the item the siblings come from. You can apply a selector to only select specific siblings, in this case all the links:
$(e.target).siblings("a").css("background", "yellow");
精彩评论