Monday, November 9, 2015

Javascript Tutorial For Beginners 10 # JavaScrip while Loop and do/while...







<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>javascript</title>
</head>
<body >

<p id="demo"></p>
<p id="demo1"></p>

<script type="text/javascript">
var a=0;
var result="";
 while (a <= -1) {
  result += "while <br>" + a;
  a++;
 }
 
 
 var b=0;
 var result1="";
 do {
  result1 += "do <br>" + b;
  b++; 
 } while (b <= -1);


document.getElementById("demo").innerHTML= result ;
document.getElementById("demo1").innerHTML= result1 ;

</script>
</body>
</html>







No comments:

Post a Comment