Debug an element by adding an ID of "test"
TIL thanks to a tweet from Devon Govett...
If you add an ID of "test" to an element:
<div id="test"></div>
You can access it using the global variable
test
from JS from the console. Could be
handy for debugging.
Bonus:
Also, incase you dind't know, any highlighted
selected in the "Elements" tab of developer
tools can be accessed directly in the console
with $0
.
🐛 Happy debugging!