Edit Code in left box and click Show Results button to see the result. | Home
<html> <body> <script type="text/javascript"> <!-- var book = "maths"; if( book == "history" ){ document.write("<b>History Book</b>"); }else if( book == "maths" ){ document.write("<b>Maths Book</b>"); }else if( book == "economics" ){ document.write("<b>Economics Book</b>"); }else{ document.write("<b>Unknown Book</b>"); } //--> </script> <p>Set the variable to different value and then try...</p> </body> <!-- Mirrored from www.tutorialspoint.com/cgi-bin/practice.cgi?file=javascript_9 by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 01 Sep 2011 09:08:32 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8"><!-- /Added by HTTrack --> </html> |