Java Script


JavaScript Tutorial


Admission Enquiry Form


Print Pattern ********** in Java Script

Example :

 
<html>
<head>
<title>Print Series 10-0</title>
</head>
<body>
<script>
var i;
for(i=1;i<=10;i++)
{
document.write("*"); 
}
</script>
</body>
</html>

Print the following Pattern
*
*
*
*
*
*
*
*
*
*

Example:

 
<html>
    <head>
    <title>Print the Pattern Function</title>
    <script>
    function star()
    {
    var i;
    for(i=1;i<=10;i++)
    {
    document.write("*<br>");
    }
    }
    </script>
    </head>
    <body>
    <form name="frm1">
    <input type="button" name="btn1" value="star1" 
    onclick="star()" />
    </form>
    </body>
    </html>