I have a HTML string like this test <b contact-id=dd4a1dbf-66f2-4791-87ee-f01511df888d>@Sandeep Mohan</b>. Now, I want to render that into <b> tag how I can do that? While rendering I'm getting this as a string and it is displaying in the web browser. I have an array and again I'm converting into a string. Again I want that string into HTML tag.
var fullName="<b contact-id="+index+">"+"@"+MentionsObj.fullName+"</b>";
contacts[mentionIndex]=index.replace(index,fullName);
}
}
}
contacts=contacts.toString();
contacts=contacts.replace(/,/g," ");
I'm converting the array into the string and then removing coma. Now, my return statement should return a html.
$(...).html("<b ... </b>")instead of$(...).text("<b ... </b>").$(contacts)or just append() or set (.html()) where you want it.