I totally agree with @dhouty and the given answer, what you want is a bit weird and...
it's an old one, but if you really want to do it, there are several ways to do it
- either you parse the styleSheets inside your document
- either you use window.getComputedStyle and its getPropertyValue
in both ways, YAGNI JQuery
the problem with the first option: you won't get the cascaded value, so let's use the second option which is more accurate.
in your case then, if you type:
window.getComputedStyle(
document.querySelector("ins.isMobile")
).getPropertyValue("content")
you'll get the value "No"
in this command, document.querySelector("ins.isMobile") has its JQuery value as $("ins.isMobile")[0], getting the first element in your document that matches with your query
if, for some reason, you need a pseudo-selector, that's what we usually do when setting content, e.g. your css will look like this
.isMobile:before{content:"no";}
then window.getComputedStyle accepts a second argument which is your pseudo-element=>
window.getComputedStyle(
document.querySelector("ins.isMobile"),
":before"
).getPropertyValue("content")
you'll get the value "no"
.isMobile{content:No}tried this?$('.isMobile').css('content')be enough?