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")
05/06/2005 | 3216549 | description | With Jquery"
| Element?
I have a table and I need the cells to have an element posi…
Here's a js fiddle of what I currently have, I am tryin…
So I have a few pictures that I want to randomly generate o…
This is my first question. I usually try to research these …
Right Floated Element Disappears When Using Columns In Firefox
I am using an ol element with column-count and column-gap p…
Setting Link Href From Child Image Src Using JQuery
I am using .wrap() to create a link around each image withi…
How To Limit The Html Table Records In Each Page
I am populating a table in my jsp which has more than 20 re…
I want to show countdown in each of my divs. Right now I ge…
Retain Dynamically Created DropDown List's Selected Value On Event Window.history.back()- JavaScript
Can use the below question as a reference to explain the co…
|
Post a Comment for "Get Css Generated Text Inside A