JSFiddle - React, Tailwind, and code Playground
HTML
<span class="test" />
<span class="test" />
<span class="test" />
CSS
.test
{
color: #f80;
font-weight: bold;
padding: 4px;
border: 2px solid #888;
}
.test:before
{
content: "My Shiny New Product";
}
JavaScript
$(function() {
//get all element class test
var test = $('.test');
//each of them, alert the content
test.each(function() {
var style = window.getComputedStyle(this, "before");
alert(style.content);
});
});