External Practical Questions
External Practical Questions
<!DOCTYPE HTML>
<html>
<head>
<title>Array Sort</title>
</head>
<body>
<script>
var a = new Array(7,6,5,4,3,2)
a.sort()
document.write("Ascending order:"+a+"<br>")
a.reverse()
document.write("Decending order:"+a+"<br>")
</script>
</body>
</html>
persistent).
11. Develop JavaScript to check given phone no is valid or not using regular
expression.
12. Create a webpage with rollover effect.
<!DOCTYPE HTML>
<html>
<head>
<title>Pull-Down menu</title>
</head>
<script>
function Display(ch)
{
page = ch.options[ch.selectedIndex].value
if(page!=" ")
{
window.location = page
}
}
</script>
</head>
<body onload="document.form1.mymenu.selectedIndex=a">
<form action = " " name="Form1">
<select name = "mymenu" onchange="Display(this)">
<option value = "practically.html">Status</option>
<option value = "practically13.html">SlideSho</option>
<option value = "practically12.html">Scrolltext</option>
</select>
</form>
</body>
</html>
14. Create slide show with group of 4 images.
<html>
<head>
<script>
myslides = new Array('b1.jpg','b2.jpg','b3.jpg','b4.jpg')
i=0
function display(slideNo)
i=i+slideNo
if(i>mysildes.length-1)
{
i=0
}
if(i<0)
{
i=myslides.length-1
}
document.slideID.src = myslide[i]
}
</script>
</head>
<body>
<h1>Displaying Banner</h1>
<img src="b1.jpg",name="slideID"width="300"height="400">
<br>
<input type="button"value="Back"onclick="display(-1)">
<input type="button"value="Forward"onclick="display(1)">
</body>
</html>
15. Develop a simple JavaScript that displays the Banners in which it slides from one
banner to another.
<html>
<head>
<script>
ban=new Array('b1.jpg','b2.jpg','b3.jpg','b4.jpg','b5.jpg')
ban_cnt=0
function display()
{
if(document.images)
{
ban_cnt++
if(ban_cnt==ban.length)
{
ban_cnt=0
}
document.BannerChange.src=ban[ban_cnt]
}
}
</script>
</head>
<body onload="display()">
<center>
<h1>Displaying banner</h1>
<img src="b1.jpg" width="400" height="300" name="BannerChange">
</center>
</body>
</html>
16. Develop a simple JavaScript for linking Banners advertisement to URL.
17. Develop a JavaScript in which when user rolls over the name of fruit the
19. Develop JavaScript to check validation for word boundary using regular
expression.
20. Develop JavaScript to create object and display the properties of object.
21. Develop JavaScript to find greatest of 3 numbers. Take the 3 numbers as input
23. Develop JavaScript to open new window and create a webpage in it.