I was trying to make an append or replace in jquery from an HTML but I'm not succeeding at it, it replaces only one <p>
that contains class .frete-gratis
but wanted to replace all with iframe
.
Here is the code I'm currently trying to work:
var $wrapper = document.querySelector('.frete-gratis'),
// Pega a string do conteúdo atual
HTMLTemporario = $wrapper.innerHTML,
// Novo HTML que será inserido
HTMLNovo = '<iframe allowtransparency="true" src="http://aws.glamour.com.br/quero_bazar/flag-counts/index.html"height="20" width="140"></iframe>';
// Concatena as strings colocando o novoHTML antes do HTMLTemporario
HTMLTemporario = HTMLNovo + HTMLTemporario;
// Coloca a nova string(que é o HTML) no DOM
$wrapper.innerHTML = HTMLTemporario;
Is it possible to work something like this?