Skip to content
Advertisement

insertRule() not inserting rule but not giving any errors

I am trying to insert a style rule directly into the head of a document.

It inserts the style element but not the code itself. No errors or anything.

JavaScript

Picture of HTML Head with style but no style code

I also asked this question on FCC but have no answers

Advertisement

Answer

The inserted CSS is not displayed in the DOM, but it does work.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement