DEV Community

artydev
artydev

Posted on • Updated on

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)