开发者

xPath of a jQuery element

开发者 https://www.devze.com 2023-03-13 16:27 出处:网络
Given a jQuery element, how do I get its XPath . I have an XPath function (somehow it doesn\'t work when I pass the jQuery element) .

Given a jQuery element, how do I get its XPath . I have an XPath function (somehow it doesn't work when I pass the jQuery element) .

Ple开发者_如何转开发ase check this jsFiddle http://jsfiddle.net/xAtx5/


Try to use var a = document.getElementById('something'); instead.

http://jsfiddle.net/pPd4b/ - it works.

PS. Or you can use for general cases:

var a = $('#something').get(0);
0

精彩评论

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

关注公众号