Edit Code in left box and click Show Results button to see the result. | Home
<html> <body> <script type="text/javascript"> <!-- var x = 1; document.write("Entering the loop<br /> "); while (x < 20) { if (x == 5){ break; // breaks out of loop completely } x = x + 1; document.write( x + "<br />"); } document.write("Exiting the loop!<br /> "); //--> </script> <p>Set the variable to different value and then try...</p> </body> <!-- Mirrored from www.tutorialspoint.com/cgi-bin/practice.cgi?file=javascript_16 by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 01 Sep 2011 09:08:37 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8"><!-- /Added by HTTrack --> </html> |