-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcarInformation.html
68 lines (62 loc) · 2.39 KB
/
carInformation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Car Information</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
}
button {
margin: 10px;
padding: 10px 20px;
font-size: 16px;
}
#carInfo {
margin-top: 20px;
padding: 20px;
border: 2px solid #000;
width: 50%;
margin-left: auto;
margin-right: auto;
font-size: 18px;
background-color: #f4f4f4;
}
</style>
</head>
<body>
<h1>Select a Car Brand</h1>
<button onclick="changeContent('Porsche')">Porsche</button>
<button onclick="changeContent('Lamborghini')">Lamborghini</button>
<button onclick="changeContent('Chevy')">Chevy</button>
<button onclick="changeContent('Ford')">Ford</button>
<div id="carInfo">
Click a button to see information about a car brand.
</div>
<script>
function changeContent(carBrand) {
const carInfoDiv = document.getElementById("carInfo");
let content = "";
switch (carBrand) {
case 'Porsche':
content = "<h2>Porsche</h2><p>Porsche is known for its high-performance sports cars, SUVs, and sedans. Their iconic 911 model is a symbol of luxury and speed.</p>";
break;
case 'Lamborghini':
content = "<h2>Lamborghini</h2><p>Lamborghini specializes in exotic, luxury supercars with aggressive designs and powerful V12 engines, like the Aventador and Huracán.</p>";
break;
case 'Chevy':
content = "<h2>Chevy</h2><p>Chevy, or Chevrolet, is a brand known for producing reliable trucks like the Silverado and popular sports cars like the Corvette.</p>";
break;
case 'Ford':
content = "<h2>Ford</h2><p>Ford is an American automaker famous for its trucks, such as the F-150, and classic cars like the Mustang.</p>";
break;
default:
content = "Click a button to see information about a car brand.";
}
carInfoDiv.innerHTML = content;
}
</script>
</body>
</html>