JSFiddle - React, Tailwind, and code Playground
by Ben Schnell
HTML
<h1>
Let's connect
</h1>
JavaScript
let stateCheck = setInterval(() => {
if (document.readyState === 'complete') {
clearInterval(stateCheck);
const h1 = document.querySelectorAll('h1');
const div = document.createElement('div');
div.setAttribute('style', 'width: 100%;');
div.innerHTML = `<img style="width: 100%; object-fit: cover; height: 300px;" src="https://www.southern.edu/administration/marketing/img/aerial-1000.jpg">`
h1[0].prepend(div);
}
}, 1);