Different results selecting HTML elements with XPath in Firefox and Internet Explorer

后端 未结 10 720
-上瘾入骨i
-上瘾入骨i 2021-01-18 10:34

I\'m trying to select a specific HTML element in a document, for firefox i just use:

xpathobj = document.evaluate(xpath, document, null,
               XPath         


        
10条回答
  •  孤街浪徒
    2021-01-18 11:13

    jQuery implements a cross-browser-compatible subset of xPath selectors with a plug-in. Your example "/HTML/BODY/DIV[9]/DIV[2]" should work in it.

    (edit - corrected thanks to Sergey Ilinsky)

提交回复
热议问题