1
Hello, I am trying to create a download button after the page content is deleted. I’m using jQuery to create the button, but I need the html to use as the "Document.write()" parameter. They can transform a jQuery object into an html string?
function criarBotaoDownload(){
var botao = $("<a>");
botao.attr("download", "download");
botao.attr("href", enderecoDoArquivo);
botao.text("Baixar!");
//?????
document.write(//Quero colocar o link aqui!);
}
criarBotaoDownload();
I thought to put inside a div and pull the value with ". innerHTML" but it seemed to me to be a great gambiarra so I came to ask here.
Thanks for your help.
Hello Anderson, in fact it is not necessary. I just wanted to know if it was possible to turn a jQuery object into html because in this case I would really like to use the
document.write()
this is possible?– Wilton Ribeiro
@Wiltonribeiro But what justifies this use?
– Woss
I am creating a script to use with browser devtools. This script will look at the code of a particular site, rewrite and then present me the result by deleting the content from the previous site.
– Wilton Ribeiro