jquery select element by xpath

后端 未结 3 1511
萌比男神i
萌比男神i 2020-11-28 08:17

I have an xpath selector. How can I get the elements matching that selector using jQuery?

I\'ve seen https://developer.mozilla.org/en/Introduction_to_using_XPath_in_

3条回答
  •  离开以前
    2020-11-28 08:59

    document.evaluate() (DOM Level 3 XPath) is supported in Firefox, Chrome, Safari and Opera - the only major browser missing is MSIE. Nevertheless, jQuery supports basic XPath expressions: http://docs.jquery.com/DOM/Traversing/Selectors#XPath_Selectors (moved into a plugin in the current jQuery version, see https://plugins.jquery.com/xpath/). It simply converts XPath expressions into equivalent CSS selectors however.

提交回复
热议问题