开发者

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜