Javascript examples for Statement:Quiz
Use if statement to check string value
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var firstName = "Tom"; if (firstName === "TOM") { document.getElementById("demo").innerHTML = "Hello TOM!"; } else {//from w w w.j av a 2 s. c o m document.getElementById("demo").innerHTML = "You're not TOM!"; } </script> </body> </html>