This is an exercise given to girlfriend by her java tutor. She wrote down the code from the drawing board, and she thinks she missed something.. (since there is no output for this when she viewed this in html, in a browser) anyway, below is the code. can someone figure out whats missing/wrong here? and post the correct version of it please? <html> <head> <title> ternary </title> </head> <body> <script language=javascript> var a=50 var b=10 document.write("<pre>") x=(a>b)?>>a is greater>>:<<b is greater>> document.write("<br>"+"a"+"\t\t=\t"+a) document.write("<br>"+"b"+"\t\t=\t"+b) document.write("<hr>") document.write("<u>"+"javascript statment\n\n"+"</u>") document.write('x=(a>b>?"a is greater":b" is greater":b"greater"\n\n') document.write("<u>"+result\n"+"</u>") document.write("<br>"+"the value of x\t\t=\t"+x+"\n\n") y=(a>b)?true:false document.write("<u>"+"javascript statment\n\n"+"</u>") document.write('y=(a>b)?true:false\n\n') document.write("<u>"+"result\n"+"</u>") if(y==true) { document.write("<br>"+"value of 'y' is true\t-\ta ia greater") } else document.write("<br>"+"value of'y'is false \t-\tb is greater") } document.write("</pre>") </script> </hr> </body> </html> Code (markup): thanks.
Thanks PresFox, She figured it out. I've added rep for you PresFox. - Thread is closed, Problem solved.