Javascript Tutorial For Beginners 9 # JavaScript Switch Statement





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

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

<script type="text/javascript">
var score = 95;
var result ;

switch (score) {
case 100:
case 95:
case 90:
result = "very good";
break;

case 60:
result = "good";
break;

case 40:
result = "ok";
break;
default:
result = "unknown";
}


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

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








Javascript Tutorial For Beginners 9 # JavaScript Switch Statement Javascript Tutorial For Beginners 9 # JavaScript Switch Statement Reviewed by Mursal Zheker on Senin, November 09, 2015 Rating: 5

Tidak ada komentar:

Diberdayakan oleh Blogger.