Change the string value using if statement - Javascript Statement

Javascript examples for Statement:Quiz

Description

Change the string value using if statement

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var firstName = "TOM";

if (firstName === "TOM") {
    document.getElementById("demo").innerHTML = "Hello TOM!";
}
</script>/*ww  w .  jav a2s  .com*/

</body>
</html>

Related Tutorials