Answers for "apply stylesheets jquery"

CSS
1

add style to stylesheet via jquery

var sheets = document.styleSheets;
$.each(sheets, (index) => {
	let url = sheets[index].href;
	if (url == "sheet url") {
       let thisSheet = sheets[index];
       //add css hover styling to stylesheet
       thisSheet.insertRule('selector {color: black !important;}');
     }
})
Posted by: Guest on April-27-2022

Browse Popular Code Answers by Language