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"Written by Jon Abrams
Related protips
1 Response
Funny, just like good ol' IE did this)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Chrome
Authors
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
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#