"default" a boolean property in JavaScript - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:text

Description

"default" a boolean property in JavaScript

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){// www. j  av  a 2  s. com
var a = {boo: false, b: false};
var dom = a.boo ? a.boo : a.b ? a.b : true;
$('#result').text(dom);
    });

      </script> 
   </head> 
   <body> 
      <pre id="result"></pre>  
   </body>
</html>

Related Tutorials