i want to check the style Tag if a classname exist or not.
if ($("head > style:eq(2)").hasClass('className'))
{
alert('yes');
}
You could access the document.styleSheets object:
see the all way in this answer
get CSS rule's percentage value in jQuery
<script>
var rules = document.styleSheets[0].rules || document.styleSheets[0].cssRules;
for (var i=0; rules.length; i++) {
var rule = rules[i];
if (rule.selectorText.toLowerCase() == ".classname") {
alert('found!!');
}
}
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With