Switch with boolean value : Switch : Statement JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Statement » Switch »

 

Switch with boolean value

















<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
var yourchoice;
yourchoice = confirm("Are you at your computer now?")
switch (yourchoice)
{
    case true:
        alert("true");
        break;
    case false:
        alert("false");
        break;
}
//  -->
</script>
</head>
<body>

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Statement
» Switch