3

I have a escaped html . I want this to be rendered as HTML components using js or jquery. Any Idea?

Html to render "<strong>Direct Cost Savings, Oracle CRM Replacement </strong> <ul><li>x users, y portal users</li><li>Integrations: Cisco (CTI), Cognos </li><li>Replacements: Oracle CRM (on-premise), RightNow</li><li>First of five phased deployments completed</li></ul>"

user1083596
  • 145
  • 1
  • 4
  • 10
  • Look at this answer here: http://stackoverflow.com/questions/1912501/unescape-html-entities-in-javascript?rq=1 – spookycoder Jul 29 '12 at 16:27

2 Answers2

1

Use .text() to get the brackets output by first rendering the < etc, and set that text as the html source:

var container = $('#render-target');
container.html(htmlToRender);
container.html(container.text());
David Hedlund
  • 128,221
  • 31
  • 203
  • 222
0

You could do something like this:

$('#item').html($("<div/>").html(yourString).text());
UltraInstinct
  • 43,308
  • 12
  • 81
  • 104