Skip to content

Commit

Permalink
fix(noJs): add the .js
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jul 21, 2024
1 parent 958bf0b commit d993501
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/javascript/misc.v1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function removeCSSRule(selector) {
for (let i = 0; i < document.styleSheets.length; i++) {
let stylesheet = document.styleSheets[i];
try {
for (let j = 0; j < stylesheet.cssRules.length; j++) {
let rule = stylesheet.cssRules[j];
if (rule.selectorText === selector) {
stylesheet.deleteRule(j);
return;
}
}
} catch {
// do nothing
}
}
}

removeCSSRule('.noJs');

0 comments on commit d993501

Please sign in to comment.