0
Hi. Please help someone to get answer.
var status=1; var mes; if(status==1) { mes="online"; } else { mes="away"; }
4 odpowiedzi
+ 3
What's the problem here?
If you want to print it then do-
document.write(mes);
+ 1
var status = 1;
var mes;
mes = document.getElementById('ab');
if (status == 1)
{
mes = mes.innerHTML= "online";
}
else
{
mes = mes.innerHTML="away";
}
Don't forget to add <p id="ab"></p> to HTML
0
use the function document.write(mes) to get the answer.
0
Thanks avinesh and dasarath singh