Last Updated: February 25, 2016
·
2.762K
· mgrassotti

JS Console Trick: Use $0 to access inspected element

WTF how did I not already know this?

when you right-click an element in your browser and choose "Inspect Element" that a reference to that element is injected into the console's scope. You can access the inspected element as $0. There is also a history kept, so $1, $2, etc. also can be used
@ebryn, https://github.com/ebryn/ember-console-utils

alt

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside