1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

Java Script Tutorials

Ternary Operator javascript

<html>
<head>
<title>Ternary Operator</title>
</head>
<body>
<Script Language="JavaScript">
A=50
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 Statement \n\n"+"</U>")
document.write('x=(A>B)?"A Is Greater" : "B Is 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 Statement \n\n"+"</U>")
document.write('y=(A>B)?true :false \n\n')
document.write("<U>"+"Result \n"+"</U>")
if(y==true)
{
document.write("<BR>"+"The value of 'y' is true \t-\t A Is Greater")
}
else
{
document.write("<BR>"+"The value of 'y' is false \t-\t B Is Greater")
}
document.write("</pre>")
</script>
</hr>
</body>
</html>

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy