-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
83 lines (81 loc) · 2.79 KB
/
index.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tesla Web page</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header" id="header">
<nav>
<img src="images/logo.png" class="logo">
<ul>
<li>
<a href="#" id="models">Model S</a>
<a href="#"id="model3">Model 3</a>
<a href="#"id="modelx">Model X</a>
<a href="#"id="modely">Model Y</a>
</li>
</ul>
<a href="#" class="btn">Reserve Now</a>
</nav>
<div class="info">
<div>
<h2 id="sec">1.9 s</h2>
<p>60 mph</p>
</div>
<div>
<h2 id="speed">200 mph</h2>
<p>Top Speed</p>
</div>
<div>
<h2 id="range">399 mi</h2>
<p>Max Range</p>
</div>
<div class="line">
</div>
<div>
<h2 id="model">Model S</h2>
</div>
</div>
</div>
<script>
var header = document.getElementById("header");
var ms = document.getElementById("models");
var m3 = document.getElementById("model3");
var mx = document.getElementById("modelx");
var my = document.getElementById("modely");
var model = document.getElementById("model");
var sec = document.getElementById("sec");
var speed = document.getElementById("speed");
var range = document.getElementById("range");
ms.onclick = function(){
header.style.backgroundImage = "url(images/image-1.png)";
model.innerHTML = "Model S";
}
m3.onclick = function(){
header.style.backgroundImage = "url(images/image-2.png)";
model.innerHTML = "Model 3";
sec.innerHTML = "1.7s";
speed.innerHTML = "220 mph";
range.innerHTML = "415 mi";
}
mx.onclick = function(){
header.style.backgroundImage = "url(images/image-3.png)";
model.innerHTML = "Model X";
sec.innerHTML = "1.5s";
speed.innerHTML = "240 mph";
range.innerHTML = "458 mi";
}
my.onclick = function(){
header.style.backgroundImage = "url(images/image-4.png)";
model.innerHTML = "Model Y";
sec.innerHTML = "1.3s";
speed.innerHTML = "250 mph";
range.innerHTML = "520 mi";
}
</script>
</body>
</html>