166
rated 0 times
[
168]
[
2]
/ answers: 1 / hits: 63541
/ 10 Years ago, wed, february 26, 2014, 12:00:00
I got in HTML the following construct:
<div id="text">
some text
</div>
If I trim the text and test it with:
$("#text").text().trim() === "some text"
it returns false
, also:
$("#text").text().trim() === "some text"
returns false
, but:
/^somes{1}text$/.test($("#text").text().trim())
returns true
.
So please tell me, what´s wrong here.
As you would suggest, I am using jQuery (1.6).
More From » jquery