[removed] use xpath in jQuery

前端 未结 8 1353
耶瑟儿~
耶瑟儿~ 2020-12-14 10:16

I have, for example, the next XPath query:

//div[span=\"something\"]/parent::div/child::div[@class=\\\"someClass\\\"]

I want to use this XP

8条回答
  •  悲&欢浪女
    2020-12-14 10:30

    jQuery only has limited support for XPath. You can see what it does support here: http://docs.jquery.com/DOM/Traversing/Selectors#XPath_Selectors

    As mentioned by @Ameoo you can use the evaluate method, which is available in most modern browsers - except, predictably, IE: jquery select element by xpath

提交回复
热议问题