XPath jQuery Element

Given a jQuery element, how do I get its XPath. I have an XPath function (somehow this does not work when I pass the jQuery element).

Please check this jsFiddle http://jsfiddle.net/xAtx5/

+3
source share
1 answer

Try using it instead var a = document.getElementById('something');.

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

PS. Or you can use for general cases:

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

All Articles