-
Notifications
You must be signed in to change notification settings - Fork 0
/
7b.html
57 lines (49 loc) · 1.53 KB
/
7b.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
<!DOCTYPE html>
<html>
<head>
<title>vehicle detail</title>
</head>
<body>
<h1>hover the mouse over the text to find the details about the vehicles</h1>
<table border="2">
<tr>
<th>MODEL</th>
<th>DETAILS</th>
</tr>
<tr>
<td id="ford" onmouseover="cal(this)" onmouseout="cal1(this)">FORD</td>
<td><textarea rows='10' cols="35" id="d1"></textarea></td>
</tr>
<tr>
<td id="merc" onmouseover="calm(this)" onmouseout="calm1(this)">MERC</td>
<td><textarea rows='10' cols="35" id="d2"></textarea></td>
</tr>
</table>
<script type="text/javascript">
var obj=[
{"model":"ford","name":"mustang","price":"2000","year":"2019"},
{"model":"mercedes","name":"s-class","price":"5000","year":"2020"}
];
function cal(x){
x.style.fontSize="25px"
var y=document.getElementById('d1');
y.innerHTML="the model is "+obj[0]['model']+" and the name of series is "+obj[0]['name']+" it is a model of "+obj[0]['year']+" with a base price of "+obj[0]['price'];
}
function cal1(x){
x.style.fontSize="1em"
var y=document.getElementById('d1');
y.innerHTML=""
}
function calm(x){
x.style.fontSize="25px"
var y=document.getElementById('d2');
y.innerHTML="the model is "+obj[1]['model']+" and the name of series is "+obj[1]['name']+" it is a model of "+obj[1]['year']+" with a base price of "+obj[1]['price'];
}
function calm1(x){
x.style.fontSize="1em"
var y=document.getElementById('d2');
y.innerHTML=""
}
</script>
</body>
</html>