forked from bashaappiness/JS-training
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjects.html
30 lines (29 loc) · 933 Bytes
/
objects.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
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>JS - Objects</title>
<meta charset="windows-1252">
<meta name="viewport" content="width=device-width">
</head>
<body>
<script type="text/javascript">
var name = "Basha";
document.write(name.length);
function person(name, age, col){
this.name = name;
this.age = age;
this.run = function(){
document.body.style.backgroundColor = col;
};
}
var akash = new person("Akash", 25, 'red');
var bineeth = new person("Bineeth", 26, 'green');
console.log(bineeth.run());
</script>
</body>
</html>