Last Updated: February 25, 2016
·
1.142K
· jonabrams

Easy access to HTML tags from Chrome's JS Console

In Chrome's JavaScript console, you can quickly access an HTML tag by referring to its ID as if it were a variable.

Given the following HTML snippet:

<div id="sidebar">My sidebar HTML goes here</div>

You can then refer to that div in the console like so:

sidebar.innerText = "Some replacement text"

1 Response
Add your response

Funny, just like good ol' IE did this)

over 1 year ago ·