Menu
Hi, I’m kinda new to javascript and I need a solution to my problem.
[code=html]alive=”yes”;
document.write (alive);
function show_confirm()
{
var r=confirm(“Are you sure you want to replace me?”);
if (r==true && alive==”yes” )
{
alert(“Goodbye..”);
displayDate();
alive=”no”;
}
else
{
alert(“Oh, thank you for sparing me!”);
}
}
Everything works fine, but document.write writes “yes” once, without ever changing it, and I was wondering if there was something that could display the variable’s value in real time. Thanks.