DEV Community

artydev
artydev

Posted on • Edited on

1 2

Sometimes you don't need getElementById

Sometimes I feel a little dumb. In one of my previous post on Mithril, I even didn't notice that you can get an element by id using window.id, yet it's still awesome...

<div id="main">
 This is the main container
</div>

<script>
 alert(main.innerHTML)
</script>

You can play with it here : WinElt

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay