Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
z3t4
· 3y ago · 0 comments
You don't even have to write document.getElementById as all html ID`s are global variables.
Comments
[–]
quickthrower2
3y ago
Wot! That is insane. But what if the id you want is a value in a string?
[–]
madeofpalk
3y ago
window[myElementsId]
[–]
quickthrower2
3y ago
That didn’t work in chrome console for me