Created
November 27, 2013 21:21
-
-
Save gilbox/7683414 to your computer and use it in GitHub Desktop.
Get a jQuery selector for any element on a page in Chrome (or any WebKit browser).
[assuming jQuery has been loaded on the page]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// right-click any element and choose copy xpath, it will look something like this: | |
//*[@id="list-results"]/div[2]/div[1]/div/ol/li[5]/div/a | |
var MY_XPATH = '//*[@id="list-results"]/div[2]/div[1]/div/ol/li[5]/div/a' | |
// then do this: | |
$($x(MY_XPATH)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment