Javascript examples for Statement:Quiz
Use if/else statement to check int value
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var age = 25;/*from w w w . j ava 2 s . co m*/ if (age > 18) { document.getElementById("demo").innerHTML = "Old enough"; } else { document.getElementById("demo").innerHTML = "Too young"; } </script> </body> </html>