Is it possible to use addRule or insertRule to also pass id selectors ?
ie :
document.styleSheets[1].addRule('div #3', 'font: 14px verdana');
which would create a rule for div ?
Or is there any kind of known work around ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your code doesn’t work because the selector is invalid. The ID selector
#3is invalid because ID selectors cannot begin with a digit.To fix this, use an ID which can be selected with a valid selector, for example
#three: