Check False or null for error checking - Javascript Data Type

Javascript examples for Data Type:boolean

Description

Check False or null for error checking

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from  w  w w  . ja  v a  2 s.c  o  m
var error = null;
var a = true;
if ((error && a) == false) {
    document.getElementById("answer").innerHTML = "Answer";
};
    }

      </script> 
   </head> 
   <body> 
      <p id="answer">...</p>  
   </body>
</html>

Related Tutorials