Reputation: 75
Why after this script:
$("<span />", { text: this.value+' <br /><br />', "class":"view" }).insertAfter(this);
I see text <br /><br />
. I want to see results not a HTML tags.
Plz any help
Upvotes: 0
Views: 54
Reputation: 15860
Replace your value to this:
html: this.value + ' <br /><br />', "class": "view"
Because you are updating the text
which is the visible value of the element.
Using html
you will write the value next to it, as the HTML content. And the <br />
will be used as a line break.
Upvotes: 0
Reputation: 57095
Use html
$("<span />", { html: this.value+' <br /><br />', "class":"view" }).insertAfter(this);
//^
Read What is the difference between jQuery: text() and html() ?
Upvotes: 1