Load a css file dynamically

// Create new link element
const link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('href', '/path/to/js/file.css');

// Append to the `head` element
document.head.appendChild(link);

More

Previous
Insert given html after or before an element
Next
Loop over a nodelist