I need to insert the HTML that refers to a hyperlinked image received through an ajax function on the page, however for security reasons I can not simply insert directly, so I'm passing this HTML code through .text () for a created div, and only after I assign this variable to .html (), however what is happening is that only the created div is recognized as HTML, the rest is displayed in plain text. How do I get everything recognized as HTML when inserting into my page while maintaining insertion security?
function start(){
timer = setInterval( function(){
var banner = $('<div>').text(banner()); // <a href="http://exemple.com/"><img src="imagem.jpg"/></a>
$('#parceiros').html(banner);
}, 3000);
}