2. Develop JavaScript to use decision making and looping statements
<!DOCTYPE HTML>
<html>
<html>
<head>
<title>EDUCBA-Demonstrated of nested if statements in javascript</title>
</head>
<title>EDUCBA-Demonstrated of nested if statements in javascript</title>
</head>
<h1>Demonstrated of nested if statements in
javascript.</h1>
<body>
<script>
var marks=75;
var participations=true;
if(marks<60)
{
document.write("<b> Better Luck Next Time.</b>")
document.write("<br/> You Are Not Eligible for This Position");
}
else
{
if(marks<=80 && participations == true)
{
document.write("<b> Your academics and sports balance your score.You are eligible for this position</b>");
document.write("<br\>Go ahead for filling Your application from.");
}
else if(marks>80)
{
document.write("<b> Your academics are great!You are eligible for this position</b>");
document.write("<br\>Proceed further for filling Your application from");
}
<script>
var marks=75;
var participations=true;
if(marks<60)
{
document.write("<b> Better Luck Next Time.</b>")
document.write("<br/> You Are Not Eligible for This Position");
}
else
{
if(marks<=80 && participations == true)
{
document.write("<b> Your academics and sports balance your score.You are eligible for this position</b>");
document.write("<br\>Go ahead for filling Your application from.");
}
else if(marks>80)
{
document.write("<b> Your academics are great!You are eligible for this position</b>");
document.write("<br\>Proceed further for filling Your application from");
}
else
{
document.write("<b>Better Luck Next Time.</b>")
document.write("<br\>You Are Not Eligible For This Position");
}
}
</script>
</body>
document.write("<b>Better Luck Next Time.</b>")
document.write("<br\>You Are Not Eligible For This Position");
}
}
</script>
</body>
</html>
Using while loops:
<!DOCTYPE
HTML>
<html>
<html>
<head>
<script type ="text/javascript">
document.write("<b>Using while loops </b><br/>");
var i=0,j=1,k;
document.write(Fibonacci series less than 40<br/>");
<script type ="text/javascript">
document.write("<b>Using while loops </b><br/>");
var i=0,j=1,k;
document.write(Fibonacci series less than 40<br/>");
while(i<40)
{
document.write(i="<br/>");
k=i+j;
i=j;
j=k;
}
</script>
</head>
{
document.write(i="<br/>");
k=i+j;
i=j;
j=k;
}
</script>
</head>
<body>
</body>
</html>
Practical Lists with Source Code :
- Writesimple JavaScript with HTML for arithmetic expression evaluation and messageprinting.
- Develop JavaScript to use decision making and looping statements.
- Develop JavaScript to implement Array functionalities.
- DevelopJavaScript to implement functions.
- DevelopJavaScript to implement strings.
- Createa webpage using form elements.
- Createa webpage to implement form event Part-I.
- Createa webpage to implement form event Part-II.
- Developa webpage using Intrinsic Java Function.
- Developa webpage for creating session and persistent cookies observe the effects withBrowser cookie settings.
- Developa webpage for placing the window on the screen and working with child window.
- Developa webpage for validation of form fields using regular expressions.
- Create a webpage with Rollovers Effect.
- Developa webpage for implementing menus.
- Developa webpage for implementing Status bars and Web Page Protection.
- Developa webpage for implementing Slideshow, Banner.