.email-address:before { content: "Email address: "; }
<style type="text/css"> .email-address:before { content: "Email address: "; } </style> <script> var rules = document.styleSheets[0].cssRules[0]; // for styleSheets for cssRules if(rules.selectorText == ".email-address::before") alert(rules.style["content"]); </script>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .email-address:before{ content: "Email address: "; } </style> </head> <body> <script> [].forEach.call(document.styleSheets, el=> { var a = [].find.call(el.rules, elt=>elt.selectorText == '.email-address::before'); a && alert(a.style.getPropertyValue("content")); }); </script> </body> </html>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"/> <style type="text/css"> .email-address:before { content: "Email address: "; } </style> <script> var rules = document.styleSheets[0].cssRules[0]; // for styleSheets for cssRules if(rules.selectorText == ".email-address::before") alert(rules.style["content"]); </script>
<!DOCTYPE html> <html> <head> <title>Untitled</title> <meta charset="utf-8"> </head> <body> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"/> <style type="text/css"> .email-address:before { content: "Email address: "; } </style> <script> // for styleSheets var style = document.styleSheets; for (var i=0; i<style.length; i++) { //for cssRules var rules = style[i].cssRules; for (var j=0; j<rules.length; j++) { if(rules[j].selectorText == ".email-address::before") { alert(rules[j].style["content"]); break; } } } </script> </body> </html>