I just started using a text editor on my page and I'm saving the data in mongoDB,
so the data will contain html tags and It'll looks something like this <b>test</b>
I'm using basicaly bootstrap for my front-end, and I'd like to show the information of that variable in my html page.
if I display something like this:
js:
event.information = '<b>test</b>'
.html or .ejs:
<p><%= event.information %></p>
Current view:
It's showing the data with the html tags e not the actual "effect" of the tag
<b>test</b>
View (that I want):
test
I just want to the page render my <%= event.information %> correctly and using the html tags to format the content and not display the html tags.
Use
<p><%- event.information %></p>
instead of
<p><%= event.information %></p>
inside of your ejs file
<%- Outputs the unescaped value into the template.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With