Create a dynamic webpage using HTML to print the numbers from 1 to 10 as soon as button is clicked?

Tripati_tutu
Posted by Tripati_tutu under JavaScript category on | Points: 40 | Views : 3098
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script language="javascript" type ="text/javascript" >
function f1()
{
for(i=1;i<=10;i++)
document.write (i +" ")
}
</script>
</head>
<body>
<form action ="">
<input type="button" name= "b1" value="Display" onclick="f1()" />
</form>
</body>
</html>

Comments or Responses

Login to post response