W
W
wikiparse2015-12-27 17:27:47
JavaScript
wikiparse, 2015-12-27 17:27:47

How to get the xpath of an element using JS?

Hello, how can, for example, by clicking on an element, get its xpath?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander N++, 2015-12-28
@wikiparse

https://jsfiddle.net/5Lqgfros/
via document.evaluate
But selectors are better for me

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question