-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
74 lines (72 loc) · 2.48 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
<!DOCTYPE html>
<html lang="en">
<!-- a fork'd from easy Tutorials https://www.youtube.com/watch?v=oClTTuTreN0 -->
<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>Redesign Tesla Car wWw Using HTML, CSS n jS | #easy Tutorials</title>
<link rel="stylesheet" href="./css/style.css" />
</head>
<body>
<div class="header" id="header">
<nav>
<!-- <img src="./img/logo.png" class="logo" /> -->
<img src="./img/teslaLogoRed.png" class="logo" />
<ul>
<li><a href="#" id="models">Model S</a></li>
<li><a href="#" id="model3">Model 3</a></li>
<li><a href="#" id="modelx">Model X</a></li>
<li><a href="#" id="modely">Model Y</a></li>
</ul>
<!-- <a href="#" class="btn">:: Reserve Now? ::</a> -->
<a href="https://www.youtube.com/watch?v=oClTTuTreN0" class="btn" target="_blank">:: Reserve Now? ::</a>
</nav>
<div class="info">
<div>
<!-- remember to make ID for h2/p inorder to make them unic for the 3/y/x-models -->
<h2>1.9 s</h2>
<p>60 mph</p>
</div>
<div>
<h2>200 mph</h2>
<p>Top Speed</p>
</div>
<div>
<h2>396 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 my = document.getElementById("modely");
var mx = document.getElementById("modelx");
var model = document.getElementById("model");
// and update text for h2/p
ms.onclick = function () {
header.style.backgroundImage = "url(./img/image-s.png)";
model.innerHTML = "Model S";
// and update innerHTML for h2/p
};
m3.onclick = function () {
header.style.backgroundImage = "url(./img/image-3.png)";
model.innerHTML = "Model 3";
};
mx.onclick = function () {
header.style.backgroundImage = "url(./img/image-x.png)";
model.innerHTML = "Model X";
};
my.onclick = function () {
header.style.backgroundImage = "url(./img/image-y.png)";
model.innerHTML = "Model Y";
};
</script>
</body>
</html>