In the modern browsers (and Firefox + firebug) you can open up your developer tools and either go to the HTML/Elements tab, or you can inspect an element to get an interactive DOM display.
You can do heaps of useful stuff here, and one thing I need to do often is manipulate/interact with a particular element using Javascript (in the console tab).
What I've been doing is using the interactive DOM to add an id attribute like 'bob', then doing whatever I need to do in the console with document.getElementById('bob') (or $('#bob')).
Ideally what I'd like to do is right click on the element and select an option like make JS variable so in the console I can just use a variable called bob,
does anyone know of any such hidden feature/addon/faster method?
You can now use the $0 variable in the devtools to get a DoM reference to the last element you selected in the Elements pane.
https://developer.chrome.com/devtools/docs/commandline-api#0-4

NB This works in Firefox, too!
Use the built-in XPath context menu as a shortcut. Here is the process:
Copy XPath from the context menuAppend the desired property/method reference
$x('//*[@id="header"]')[0].innerText
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With