Javascript examples for Browser Object Model:Window getComputedStyle
Get pseudo element, CSS content value
<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 .j a v a 2 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>