Much of the code you provided was correct.
Only what was missing was you printing the image object inside your HTML
thus below.
let senha = "teste";
let escrita = window.prompt("SENHA");
if(senha === escrita){
document.write(`<img src="https://via.placeholder.com/350x90.png?text=ACERTOU!">`);
}else{
document.write(`<img src="https://via.placeholder.com/350x90.png?text=ERROU!">`);
}
you can also include using jquery this way:
let senha = "teste";
let escrita = window.prompt("SENHA");
if(senha === escrita){
$("#seuobjetopodeserumadiv").html(`<img src="https://via.placeholder.com/350x90.png?text=ACERTOU!">`);
}else{
$("#seuobjetopodeserumadiv").html(`<img src="https://via.placeholder.com/350x90.png?text=ERROU!">`);
}
vdd vc has reason.
– Jasar Orion