Skip to content Skip to sidebar Skip to footer

Get Css Generated Text Inside A With Jquery

I have a table like this:

Solution 1:

You can get it like following using window.getComputedStyle.

var text = window.getComputedStyle($('#state')[0], ':before').contentalert(text)
.state-c:before {
  content: "Confirmed";
}
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><tableid="orders"><tr><td>05/06/2005</td><td>3216549</td><td>description</td><td>2.000,00</td><td>100</td><td>20,00</td><td><divid="state"class="state-c"></div></td><td><ahref="modify.php?id=222"><spanclass="bt-edit">EDIT</span></a></td></tr><table>

Solution 2:

var s = '.state-c:before { content: "Confirmed";}';
var m = s.match(/"(.*?)"/);
alert(m[1]); // m[1] = quoted

just pass the css as a string and get the text inside double quotes. hope this will help you

Solution 3:

Maybe you can try .find("#state").text("my text")

Post a Comment for "Get Css Generated Text Inside A

05/06/20053216549description With Jquery"