开发者

How can one select specific sibling of a context node using jQuery?

How can one select a specific sibling of a context node using jQuery? Specifically, gi开发者_StackOverflowven context node myContextNode select the sibling span with class myClass.

document.evaluate("../span[@class='myClass']",
    myContextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).
    singleNodeValue;


You can use .siblings() with a selector, like this:

$(myContextNode).siblings("span.myClass")
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜