Print Series 1 to 10 in Java Script
Example :
<html>
<head>
<title>Print Series 1-10</title>
</head>
<body>
<script>
var i;
for(i=1;i<=10;i++)
{
document.write(i+" ");
}
</script>
</body>
</html>
Print Series 1 to 10 in Java Script on Button Click Using Function
Example:
<html>
<head>
<title>Print Series 1-10 using Function</title>
<script>
function series()
{
var i;
for(i=1;i<=10;i++)
{
document.write(i+" ");
}
}
</script>
</head>
<body>
<form name="frm1">
<input type="button" name="btn1" value="series 1-10"
onclick="series()" />
</form>
</body>
</html>