-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdummy.html
66 lines (42 loc) · 1 KB
/
dummy.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Dom Project</title>
</head>
<body onload="alert('Hello world')">
<h1> My heading</h1>
<form id="form">
<label for="number label" > Car :</label>
<input type="text" id="TextBox">
<input type="button" value="Check Car" >
</form>
</body>
<script type="text/javascript">
class Car {
constructor(brand) {
this.carname = brand;
}
present() {
return 'I have a ' + this.carname;
}
}
class Model extends Car {
constructor(brand, mod) {
super(brand);
this.model = mod;
}
show() {
alert(this.present() + ', it is a ' + this.model);
// return this.present() + ', it is a ' + this.model;
}
}
function brandd(){
var cuBrand = document.getElementById("TextBox").value;
return cuBrand;
}
let myCar = new Model(brandd(), "Mustang");
// document.getElementById("demo").innerHTML = myCar.show();
console.log(myCar.present());
console.log(myCar.show());
</script>
</html>