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);
精彩评论