0

I have a field Value for segmentations as <Value TBD>, which is not getting printed in the HTML table.

This is the way I'm trying to populate the value:

  if($("th[data-field='rating']").get(0) !== undefined) {
      debugger;
    row.append($("<td />").css("font-size", "12px").html(""+segmentations+""));
  }

It is taking other normal character values like 'Adoption' but not able to print <Value TBD>. Is there any way to escape this '<' characters inside </tr> tag?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
  • Should be `($("")` – Asons May 21 '18 at 22:40
  • Does `segmentations` actually contain HTML or just text? If there's just text, use the `text()` method instead. It fhere's HTML, stop putting things that looks like an element in the text. – adeneo May 21 '18 at 22:45
  • yes, it contains HTML tags Entyvio (Customer Belief:)
    , If i only use .text(""+segmentations+"") without .html(), it will show me the tags, and if i only use both then the table css is getting disturbed
    – Saikat Neogy May 21 '18 at 22:50
  • sorry, with .html() i'm getting the tag : row.append($("").css("font-size", "12px").text(""+segmentations+"").html()); – Saikat Neogy May 21 '18 at 22:53
  • @LGSon, i tried to use ($("") but it is working same as before – Saikat Neogy May 21 '18 at 22:56

0 Answers0