3 ms·
Like this: https://stackoverflow.com/questions/15505225/inject-css-stylesheet-as-string-using-javascript https://stackoverflow.com/questions/15505225/inject-cs
by Izkata 7y ago
Like this: https://stackoverflow.com/questions/15505225/inject-css-stylesheet-as-string-using-javascript https://stackoverflow.com/questions/15505225/inject-css-styl...
var node = document.createElement('style');
node.innerHTML = '* { outline: 2px dotted orangered; };
document.body.appendChild(node);
- err4nt 7y agoThis should suffice, no need to make a variable, this can all be done at once: document.head.appendChild(document.createElement('style')).textContent = '* { outline: 2px dotted orangered'