nowox
0
Q:

nested if javascript

if(a == 'value'){
    doSomething();
    if(b == 'another value'){
        doAnotherThing();
    }
}
4
<script type = "text/javaScript"> 
// JavaScript program to illustrate nested-if statement 
  
var i = 20; 
  
if (i == 10) 
  document.write("i is 10"); 
else if (i == 15) 
  document.write("i is 15"); 
else if (i == 20) 
  document.write("i is 20"); 
else
  document.write("i is not present"); 
< /script> 
2

New to Communities?

Join the community