WP Lab Part B
WP Lab Part B
<head>
<title>Ordered list</title>
</head>
<body bgcolor="red">
<h4>list of fruits</h4>
<li>Strawberry</li>
<li>Fig</li>
<li>Mango></li>
<li>Pineapple></li>
</ol>
<h4>list of vegetables</h4>
<li>tomato</li>
<li>cauliflower</li>
<li>carrot</li>
<li>beans<li>
</ol>
<h4>list of cereals</h4>
<li>jowar</li>
<li>groundnuts</li>
<ol>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------
---------
2. Write a HTML Program to display list of fruits, vegetables and
cereals using Unordered list.
<html>
<head>
<title>unOrdered list</title>
</head>
<body bgcolor="pink">
<h4>list of fruits</h4>
<ul type="disc">
<li>Strawberry</li>
<li>Fig</li>
<li>Mango</li>
<li>Pineapple</li>
</ul>
<h4>list of vegetables</h4>
<li>tomato</li>
<li>cauliflower</li>
<li>carrot</li>
<li>beans<li>
</ul>
<h4>list of cereals</h4>
<ul type="circle">
<li>rice</li>
<li>jowar</li>
<li>groundnuts</li>
<ul>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------
---------
3. Write a HTML Program to demonstrate Confirm Box.
<html>
<head>
function show_confirm()
if(r==true)
else
{
</script>
</head>
</body>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------
---------
4. Write a HTML Program to demonstrate Prompt Box.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function show_prompt()
}
</script>
</head>
<body>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------
---------
5. Write a JavaScript program to execute Mouse Events.
<html>
<head>
<script>
{ element.style.color = clr;
</script>
</head>
<body>
<h1 onmousedown="myFunction(this,'red')"
onmouseup="myFunction(this,'green')">
Click the text to change the color.<br/>A function, with parameters, is triggered
when the mouse button is pressed down, and again,<br/>
</h1>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------
---------
6. Write a JavaScript program to convert Lower Case to Upper Case.
<html>
<head>
<title>To convert the text to Uppercase</title>
<script type="text/javascript">
function change_case()
{
document.form1.type.value=document.form1.type.value.toUpperCase();
}
</script>
</head>
<body onLoad="form1.type.focus();">
<center><h1>To convert the character to Uppercase</h1></center>
<form name="form1" method="post">
Enter User ID<input type="text" name="type"value="">
<input type="button" value="Change to Upper"
onclick="change_case();"></form>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------
---------
7. Write a JavaScript program to generate Fibonacci series.
<html>
<head><title>Fibonacci Series</title></head>
<body>
<script
type="text/javascript">
var var1 = 0;
var var2 = 1;
var var3;
var num = prompt("Enter the limit to generate fibonacci no",0);
document.write(var1+"<br />");
document.write(var2+"<br />");
for(var i=3; i <= num;i++)
{
var3 = var1 + var2;
var1 = var2;
var2 = var3;
document.write(var3+"<br />");
}
</script
>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------
---------
8. Write a JavaScript program to find the reverse of a given number.
<html>
<head>
<script>
function
palin()
{
var a,no,b,temp=0;
no=Number(document.getElementById("no_input").value
); b=no;
while(no>0)
{
a=no%10;
no=parseInt(no/10);
temp=temp*10+a;
}
alert(temp);
}
</script>
</head>
<body>
Enter any Number: <input id="no_input">
<button onclick="palin()">Check</button></br></br>
</body>
</html>