开发者

jquery: how to select all other elements?

开发者 https://www.devze.com 2022-12-09 18:35 出处:网络
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.

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

精彩评论

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