I have HTML data stored in database which I wish to display as is. It keeps converting
tags to <br />
which is a behavior I do not want. I
<br />
== <br />
You just need to Decode the output to get back the original HTML.
Use javascript unescape function
Your problem is with
$("#venueaddress").text(venueaddress2);
you should use
$("#venueaddress").html(venueaddress2);
Text will encode any html character and will display it in span as encoded, html will not.
You can also replace the chars with the actual <br/>
tag.
myString.replace(/<br>/g, '<br/>')
Your html data is being "escaped." This prevents people from sending the <script>
tag to unsuspecting people at their browser.
Fix: first you'll need to determine if your issue is a "bug" or a "feature."
Escaping html is usually a good thing. Especially if the only issue is one of presentation.
For example, a work around might be to insert newline characters rather than the br element.
Presumably because when you are inserting it into the DOM, you are inserting it as text and not as HTML.
Since you haven't show the code you are using to do that, it is hard to say for sure, or to say what the best way to change it so it expects HTML would be.