[Solved] I want to add css to document.write in js [closed]


document.write('<h1 id=item>text</h1>')

const item = document.querySelector('#item')

item.style.color = "blue"
item.style.fontSize = "16px"
... and other

But as they said above – it’s better not to do

solved I want to add css to document.write in js [closed]