html
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
<!DOCTYPE html>
<html>
<head>
<title>inheritance: to eliminate duplicate code and make the app more efficient.</title>
</head>
<body>
<script>
class User {
constructor (name){
this.name = name;
this.status = "";
}
updateStatus (status){
this.status = status;
}
}
window.onload = () => {
//begin process
//create intance user
var user1 = new User ("Matt");
//inheritance
user1.updateStatus ("Writting code html script.");
//display
let p = document.createElement ("p");
let node = document.createTextNode (user1.status);
p.appendChild (node);
document.body.appendChild (p);
//end process
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run