-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript
More file actions
40 lines (39 loc) · 1.2 KB
/
javascript
File metadata and controls
40 lines (39 loc) · 1.2 KB
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
<!doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src ="colors.js"></script>
</head>
<body>
<h1>Javascript</h1>
<a href = "index.html">HOME </a> </br>
<input type="button" value ="night" onclick="nightdayHandler(this);"></br>
<script>
var coworkers = {
"programmer" : "egoing",
"designer":"leezche"
};
document.write("programmer : " + coworkers.programmer+"</br>");
document.write("designer : " + coworkers.designer+"</br>");
coworkers.bookkepper = "duru";
document.write("bookkepper : " + coworkers.bookkepper+"</br>");
coworkers["data scientist"] = "taeho";
document.write("data scientist : " + coworkers["data scientist"]);
</script>
<h2>Iterate</h2>
<script>
for(var key in coworkers){
document.write(key + " : "+ coworkers[key]+"<br>");
}
</script>
<h2>Property & Method</h20>
<script>
coworkers.showAll = function(){
for(var key in this){
document.write(key+' : ' + this[key] + '<br>');
}
}
coworkers.showAll();
</script>
</body>
</html>