I'm wondering if I can add CSS code as a string the way I can add HTML code through JavaScript, e.g.:
var div = document.createElement("div");
div.innerHTML =
'<div id="hs1"></div>\n' +
'<div id="hs2"></div>\n' +
'<div id="hs3"></div>\n'
document.body.appendChild(div);
Can I, in a similar fashion, add a giant CSS code?
Basically I have HTML + CSS + JS code, that I want to put into a .js file instead of a .html.
I'm new to web development, so I don't know. Is this even possible?
<style>tag, populating it with rules, and injecting it?