Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views2 pages

Program 5

This document is an HTML program for a lab manual that allows users to select a country from a dropdown menu to display its capital in a text box. The program includes basic styling and a JavaScript function to update the capital field based on the selected country. It features countries like India, Australia, America, the United Kingdom, and Germany.

Uploaded by

sigcegroup
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Program 5

This document is an HTML program for a lab manual that allows users to select a country from a dropdown menu to display its capital in a text box. The program includes basic styling and a JavaScript function to update the capital field based on the selected country. It features countries like India, Australia, America, the United Kingdom, and Germany.

Uploaded by

sigcegroup
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Program:

<!DOCTYPE html>
<html>
<head>
<title>WT Lab Manual Program No. 5</title>
<style>
h1 {
color: red;
text-align: center;
}
.textbox1 {
color: blue;
font-size: 30px;
font-weight: bold;
}
</style>
</head>
<body>
<center>
<h1>Select the country name to find its capital</h1>

<form name="myform">
Select Country:
<select name="country" id="sbox1" onchange="myFunction()" required>
<option value=""></option>
<option value="NEW DELHI">INDIA</option>
<option value="CANBERRA">AUSTRALIA</option>
<option value="WASHINGTON D.C">AMERICA</option>
<option value="LONDON">UNITED KINGDOM</option>
<option value="BERLIN">GERMANY</option>
</select>
<br><br>
Capital:
<input type="text" class="textbox1" id="sbox2" readonly>
</form>
</center>

<script>
function myFunction() {
var a = document.getElementById("sbox1").value;
document.getElementById("sbox2").value = a;
}
</script>
</body>
</html>

Output:

You might also like