What is the best way to read all CSS selectors from my CSS $("head > style:eq(0)").html(); ?
What is the best way to read all CSS selectors from my CSS $(head
Share
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.
It varies across browsers. jQuery doesn’t help you here, because inspecting the stylesheet data is a quite an unusual thing to want to do, and older/niche browsers can’t do it at all. Are you sure you need to inspect stylesheets? What are you aiming to do?
cssRulesandcssTextare standard DOM Level 2 Style properties,rulesandselectorTextare for IE<9 compatibility. Note IE<9 will return recreated rules so you’ll see eg.PADDING-BOTTOM: 0pt; PADDING-LEFT: 0pt; PADDING-RIGHT: 0pt; PADDING-TOP: 0ptif the original style you specified waspadding: 0.