skip to Main Content

Why DOM is not updated when using CSS insertRule?

I want to add a CSS rule to the DOM: This is my code function empty_rule(sheet, class_name) { const index = sheet.cssRules.length; sheet.insertRule(`.${class_name} { }`, index); return sheet.cssRules[index]; } function make_style() { const $head = $('head'); const $style = $('<style…

VIEW QUESTION
Back To Top
Search