brianium / watermarkjs

:rice_scene: Watermarking for the browser

Home Page:http://brianium.github.io/watermarkjs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace old image

leonardop21 opened this issue · comments

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); });

Solved

	$(".img-responsive").remove();

Thank's for your time