It depends on the browser. I do not believe that IE supports this in any way, but for FireFox and Webkit browsers you can use the following:
window.getComputedStyle(element, pseudo-selector);
For example:
window.getComputedStyle(document.body, ':before');
See: getComputedStyle
source
share