Replace old image
leonardop21 opened this issue · comments
Leonardo commented
I have a button to generate the image with random text, so far so good, but if I click again, it adds the new image to the side, I wanted the previous one to be replaced by the current one. How could he do that?
watermark(["img/bg.jpg"]) .image(ur(naoSei, "48px Josefin Slab", "#fff", 0, 48)) .then(function(img) { var kk = document.getElementById("upper-right").appendChild(img); var aff = document.getElementById("upper-right").src=img; var inocencia = document.getElementById("upper-right").innerHTML; kk.classList.add("img-responsive") is_img(kk); });
Leonardo commented
Solved
$(".img-responsive").remove();
Thank's for your time