Home
<!DOCTYPE html> <html> <body> <h1>Demo: JavaScript Boolean</h1> <p id="p1">1 > 2 = </p> <p id="p2">a < b = </p> <p id="p3">a > b = </p> <p id="p4">a + 20 > b + 5 = </p> <script> var a = 10, b = 20; var result = 1 > 2; // false document.getElementById("p1").textContent += result; result = a < b; // true document.getElementById("p2").textContent += result; result = a > b; // false document.getElementById("p3").textContent += result; result = a + 20 > b + 5; // true document.getElementById("p4").textContent += result; </script> </body> </html>
Result: