开发者

xPath of a 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜