0% found this document useful (0 votes)
15 views5 pages

Interactive Color and Laptop Selector

The document contains two HTML programs. Program 1 allows users to change the background color of the webpage by selecting a color from a dropdown menu, while Program 2 enables users to select a laptop brand, displaying the corresponding image and description. Both programs utilize JavaScript for interactive functionality.

Uploaded by

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

Interactive Color and Laptop Selector

The document contains two HTML programs. Program 1 allows users to change the background color of the webpage by selecting a color from a dropdown menu, while Program 2 enables users to select a laptop brand, displaying the corresponding image and description. Both programs utilize JavaScript for interactive functionality.

Uploaded by

manav2007kuril
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Program 1

Code:

<html>

<title>demo</title>

<body>

<form name="frm1"><center>

<select name="bgcolor" onchange="navigate([Link])">

<option value="">select colors</option>

<option value="red">red</option>

<option value="yellow">yellow</option>

<option value="blue">blue</option>

<option value="green">green</option>

</select>

</center>

</form>

</body>

<script>

function navigate(value) {

if (value === 'red') {

[Link] = 'red';

} else if (value === 'yellow') {

[Link] = 'yellow';

} else if (value === 'blue') {

[Link] = 'blue';

} else if (value === 'green') {

[Link] = 'green';

</script>

</html>
Program 2

Code:

<html>

<title>laptop_model_optionlist</title>

<body>

<center>

<img src="[Link]" name="image" width="300" height="300">

<br><br><br>

<select id="Dropdown" onchange="change([Link])">

<option value="DEFAULT">--Select a Brand--</option>

<option value="LENOVO">Lenovo</option>

<option value="HP">HP</option>

<option value="DELL">Dell</option>

</select>

</center>

<center>

<b><h1><p id="para"></p></h1></b>

</center><script>

function change(value) {

if (value === 'LENOVO') {

[Link] = '[Link]';

[Link]("para").innerHTML = " this is a lenovo Laptop model ";

} else if (value === 'HP') {

[Link] = '[Link]';

[Link]("para").innerHTML = " this is a HP laptop model ";

} else if (value === 'DELL') {


[Link] = '[Link]';

[Link]("para").innerHTML = " this is a DELL laptop model";

</script>

</body>

</html>

You might also like