-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathObject2.html
More file actions
27 lines (25 loc) · 880 Bytes
/
Copy pathObject2.html
File metadata and controls
27 lines (25 loc) · 880 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Object2</title>
</head>
<body>
<script>
function Developer(name, lastname, age, sex, country ){
this.name=name;
this.lastname=lastname;
this.age=age;
this.sex=sex;
this.country=country;
}
var BE_Developer=new Developer("Bill", "Ivanov", "55", "male", "Ukraine");
var color=["azure", "blanchedalmond", "gainsboro", "yellow", "beige", "darkseagreen", "steelblue"];
for(var key in BE_Developer) {
document.write("<div style='background-color:" + color[Math.round(Math.random() * (color.length))] + " ; width: 70%'>")
document.write("<p style='color: darkslategray; font-family: cursive; text-align: center;'>" + key + " = " + BE_Developer[key] + "</p>");
document.write("</div>");
}
</script>
</body>
</html>