In Association with Amazon.in   Flipkart

Friday, July 12, 2013

JavaScript If Ladder Statement Example

If  Ladder :

In multiple if every if is independent  ( if true stop)
In Else if every if is dependent  ( if false continue next )

                <script>
                per=47.90;
              if(per>=75)
document.write("A Grade");
else   if(per>=60)
document.write("B Grade");
else   if(per>=45)
document.write("C Grade");
else 
document.write("D Grade");
                </script>

No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...