Lesson 36: The Script and Its Effect



The Script

<SCRIPT LANGUAGE="JavaScript">
var usernum = prompt("How many times should I write Happy?","0")
loops=eval(usernum)
num=1
while (num <= loops)
{
document.write("Happy ")
num=num+1
}
document.write("Birthday")
</SCRIPT>

 

The Script's Effect

 

Back to the Index Page