Reputation: 2696
I have in my database a column that stores html data i.e <p>this is a test</p>
and I am loading that data into a javascript form field, however, the html tags are not being parsed properly.
They are being displayed such as;
<p>This is a test</p>
Can someone give me a hint as to what I am doing wrong please.
Upvotes: 0
Views: 58
Reputation: 4032
Parse your text using .html
function
var text= $('<textarea />').html("<p>This is a test</p>").text();
alert(text);
Upvotes: 1
Reputation: 11
Looks like the tags are being saved as their HTML entity equivalent. You'll have to convert them to their actual character if that's what you require.
Upvotes: 0