JS Path
I am going through chrome dev tools docs, there is this "Copy JS Path" that they are telling to copy. I also pasted it in a console which evaluated to an expression.
But I dont understand what exactly is a JS Path and why we copy it. I googled but still cant find anything...
LINK: https://developer.chrome.com/docs/devtools/dom/#path
Chrome for Developers
Get started with viewing and changing the DOM | Chrome DevTools ...
How to view nodes, search for nodes, edit nodes, reference nodes in the Console, break on node changes, and more.
3 Replies
Honestly its bad naming on their part.
All it is doing is exactly what that link states. Its giving you a querySelector('') prefilled with the selector "path".
https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector
it should instead be named something like "copy css selector" or something
thanks i get it now
it was just confusing calling it "js path"
also firefox doesnt have this option, smart
it has copy css selector
and css path
which is all we need