Link to home
Start Free TrialLog in
Avatar of nzinsli
nzinsliFlag for United States of America

asked on

.html() not decoding html elements

I have a string that has some encoded html characters...
str = '<br />'

Open in new window

And I'm using jQuery to fill an elements' html with that string...
$('#element').html(str);

Open in new window

But when I view it in the browser I get "<br />" instead of a line break. I thought html() should decode everything into html formatting?
ASKER CERTIFIED SOLUTION
Avatar of haloexpertsexchange
haloexpertsexchange
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nzinsli

ASKER

Ahh, that makes sense now. I should've realized that. Thanks!