Break statement in a if statement : Break : Statement JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Statement » Break »

 

Break statement in a if statement

















<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
var x = 0, breakat;
breakat = prompt("Pick a number between 1 and 10 to break at""");
while (x < 10) {
    if (x == breakat)
        break;
    }
    document.write(x);
    x++;
}
//  -->
</script>
</head>
<body>

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Statement
» Break