Page 364 - Webapplication11_C11_Flipbook
P. 364
After clicking on OK the button output will appear in new window:
Example:
<HTML>
<BODY>
<SCRIPT>
/*Accept percentage and print the remark based on it:
% Remark
>=80 Excellent
>=60 and <80 Very Good
>=40 and <60 Good
<40 Work Hard
*/
var perc=prompt("Enter percentage");
document.write("Percentage entered is :"+perc);
document.write("<br> <br>");
if (perc>=80) {
document.write("Excellent");}
else if (perc>=60 && perc <80) {
document.write("Very Good");}
else if (perc>=40 && perc <60) {
document.write("Good");}
else {
document.write("Work Hard");}
</SCRIPT>
</BODY>
</HTML>
On running the above program, we get the following output:
362 Touchpad Web Applications-XI

