What is the "== $0" that appears next to each line of code in Elements tab?

4,343 views
Skip to first unread message

Deepak Kamat

unread,
Apr 16, 2016, 2:05:39 AM4/16/16
to Google Chrome Developer Tools
After I updated Chrome to the newest stable version 50, there's something strange appearing next to each line of code in the Elements tab when you have it in focus. 

"== $0" appears next to each line, as you can see in the screenshot I have attached. 

I am not sure what it is for, it would really be helpful if I can learn about the reason behind putting it there :) Thanks!


PhistucK

unread,
Apr 16, 2016, 2:12:07 AM4/16/16
to Google Chrome Developer Tools
Are you familiar with the console command line API? If not read this -

Basically, this is a hint to tell you that if you type $0 in the console, it will be equal to that element. So, you can type -
$0.appendChild(document.createElement("div"))
And the selected element in the Elements panel will be appended a <div>.

I agree this is a bit of an overkill and you really only need to see that once, though (in order to ask this exact question and familiarize yourself with the feature). Perhaps a tooltip (or an information bar, like the Sources panel shows) is a better approach than polluting the already cluttered tree with this not very useful tip (not very useful only after you know how to use it).


PhistucK

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/b5e3ffb4-4300-4b37-9433-e1fbd3d5797a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages