Write an HTML page that contains a selection box with a list of 5 countries. When the user selects a country, its capital should be printed next to the list. Add CSS to customize the properties of the font of the capital (color, bold and font size).
<html>
<head>
<title>capitals of countries</title>
<style>
p{
color:red;
font-weight:bold;
font-size:50;
}
</style>
<script language="javascript">
function capital()
{
var cunt=document.forms["frm1"].country.value;
var capital=" Please select any country ";
if( cunt=="india")
{
capital="NEW DELHI";
}
if( cunt=="china")
{
capital="BEIJING";
}
if( cunt=="pakistan")
{
capital="ISLAMABAD";
}
if( cunt=="bangladesh")
{
capital="DHAKA";
}
if( cunt=="japan")
{
capital="TOKYO";
}
if( cunt=="select")
{
capital="Please select any country";
}
document.getElementById("capt").innerHTML=capital;
}
</script>
</head>
<body>
<form name="frm1">
<br/>
<center>
Select a Country : <select name="country" onchange="capital()">
<option value="select">--SELECT--</option>
<option value="india">INDIA</option>
<option value="china">CHINA</option>
<option value="pakistan">PAKISTAN</option>
<option value="bangladesh">BANGLADESH</option>
<option value="japan">JAPAN</option>
</select>
<br/>
<br/>
<font color="green" size="6">Capital is :</font> <p id="capt"></p>
</center>
</form>
</body>
</html>
1) Write an HTML page including JavaScript that takes a given set of integer numbers and shows them after sorting in descending order. View Solution
2) Write an HTML page including any required JavaScript that takes a number from one text field in the range of 0 to 999 and shows it in another text field in words. if the number is out of range, it should show “out of range” and if it is not a number, it should show “not a number” message in the result box. View Solution
3) Write an HTML page that has one input, which can take multi line text and a submit button. Once the user clicks the submit button, it should show the number of characters, words and lines in the text entered using an alert message. Words are separated with white space and lines are separated with new line character. View Solution
4) Write an HTML page that contains a selection box with a list of 5 countries. When the user selects a country, its capital should be printed next to the list. Add CSS to customize the properties of the font of the capital (color, bold and font size). View Solution
5) Create an XML document that contains 10 users information. Write a java program which takes users id as input and returns the users details by taking the user information from the XML document using DOM parser. View Solution
6) Create an XML document that contains 10 users information. Write a java program which takes users id as input and returns the users details by taking the user information from the XML document using SAX parser. View Solution
7) A user validation web application, where the user submits the login name and password to the server. The name and password are checked against the data already available in database and if the data matches, a successful login page is returned. Otherwise a failure message is shown to the user. View Solution
8) A user validation web application, where the user submits the login name and password to the server. The name and password are checked against the data already available in xml file (users.xml) and if the data matches, a successful login page is returned. Otherwise a failure message is shown to the user. View Solution
9) A user validation page web application, where the user submits the login name and password to the server. The name and password are checked against the data already available in database and if the data matches, a successful login Message is returned. Otherwise a failure message is shown to the user. Use AJAX to show the result on the same page below the button. View Solution
10) A simple calculator web application that takes two numbers and an operator (+,-,/,* and %)from an HTML page and returns the result page with the operation performed on the operands. View Solution
11) Modify the above program (Simple Calculator) such that it stores each query in a database and checks the database first for the result. If the query is already available in the DB, it returns the value that was previously computed (from DB) or it computes the result and returns it after storing the new query and result in DB. View Solution
12) A web application takes a name as input and on submit it shows a hellopage where is taken from the request. It shows the start time at the right top corner of the page and provides the logout button. On clicking this button, it should show a logout page with Thank You message with the duration of usage. (Use session to store name and time). View Solution
13) A web application that takes name and age from an HTML page. If the age is less than 18, it should send a page with “hello<name> you are not authorized to visit this site” message, where <name> should be replaced with the entered name. Otherwise it should send “Welcome <name> to this site “message. View Solution
14) A web application for implementation: The user is first served a login page which takes user’s name and password. After submitting the details the server checks these values against the data from a database and takes the following decisions. • If name and password matches serves a welcome page with user’s full name. • If name and password doesn’t match, then serves “password mismatch” page. • If name is not found in the database, serves a registration page, where user’s full name is asked and on submitting the full name, it stores, the login name, password and full name in the database (hint: use session for storing data, submitted login name and password). View Solution
15) A web application that lists all cookies stored in the browser on clicking “list Cookies ”button .Addcookies if necessary View Solution