Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to inject html code using jquery? [duplicate]

Tags:

html

jquery

I have a tag that I want to inject some html code... ...the html code is like this...

line:1   3spaces b4<br /><br />line:3     5spaces

b4<br /> 5spaces b4, line: 4

If I use .text inject this code, it just shows text, but not the html code. I would like to convert it to a html code, how can I do so?? Thank you.

like image 667
Tattat Avatar asked Aug 25 '26 20:08

Tattat


1 Answers

Use .html() instead of .text()

like image 176
Mark Pope Avatar answered Aug 27 '26 17:08

Mark Pope