Javascript examples for Browser Object Model:Window getComputedStyle
Using getComputedStyle to get pseudo element from CSS
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #item::after {//from w w w .jav a2 s.c om content: 'test'; } </style> <script type="text/javascript"> window.onload=function(){ console.log(window.window.getComputedStyle(document.querySelector('#item'), ':before')); } </script> </head> <body> <div id="item"> </div> </body> </html>