Edit Code in left box and click Show Results button to see the result. | Home
<html> <body> <script type="text/javascript"> <!-- var a = 10; var b = 20; var linebreak = "<br />"; document.write("((a > b) ? 100 : 200) => "); result = (a > b) ? 100 : 200; document.write(result); document.write(linebreak); document.write("((a < b) ? 100 : 200) => "); result = (a < b) ? 100 : 200; document.write(result); document.write(linebreak); //--> </script> <p>Set the variables to different values and different operators and then try...</p> </body> <!-- Mirrored from www.tutorialspoint.com/cgi-bin/practice.cgi?file=javascript_conditional_operator by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 01 Sep 2011 09:08:29 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8"><!-- /Added by HTTrack --> </html> |