Sunday, January 12, 2014

JavaScript If/else Example

<html>
<body>
<script>
var m=10;
if(m==0)
{
document.write("m is equal to 0");
}
else if(m==10)
{
document.write("m is equal to 10");
}
else if(m==20)
{
document.write("m is equal to 20");
}
else
{
document.write("m is more than 20");
}
</script>
</body>
</html>

No comments:

Post a Comment