This post may seem duplicated, but I have tried several ways and the problem is not solved.
I have a DataTable in which I dynamically load HTML tags.
These labels, instead of being like this:
<img src="ruta" />
they look like this:
<img src="ruta"/>
I have made a jquery script that replaces the characters <
and >
with <
and >
respectively.
The problem is that only the first appearance replaces me, leaving a message like this:
<img src="ruta"/> <img src="ruta"/> <img src="ruta"/> <img src="ruta"/>
My Jquery code is as follows
$(".message").each(function(){
var $this = $(this);
var t = $this[0].innerHTML;
$this.html(t.replace('<','<').replace('>', '>'));
});
My HTML looks like this:
<div class="message"><img src="ruta"/> <img src="ruta"/> </div>
That div is part of a row of a datatable.
How could I make Datatable render the HTML tags or have JQUERY replace the characters in ALL the messages instead of just the first one.
Thank you.