joexn joexn - 3 months ago 15x
HTML Question

Use custom tag using JavaScript only

On my site, as a little footer I guess, I use the tag

<joexn id="yo">

and the javascript

var div = document.getElementById('yo');
div.insertAdjacentHTML( 'beforeBegin', '' );

This produces a watermark/footer and want I want to know is how can I change it so the tag is just
using Javascript only. I want minimalist code only and no clutter. I tried using
but that didn't work.

What's the easiest method?


try using document.querySelector(): DEMO

var div = document.querySelector('joexn');
div.insertAdjacentHTML( 'beforeBegin', '' );