-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathobject_constructors.html
More file actions
29 lines (25 loc) · 883 Bytes
/
object_constructors.html
File metadata and controls
29 lines (25 loc) · 883 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
28
29
<!doctype html>
<html lang="en">
<head>
<title>JavaScript Tutorial - Objects and Constructors</title>
<link rel="stylesheet" href="css/foundation.min.css"></link>
</head>
<body>
<!-- JAVASCRIPT -->
<script type="text/javascript">
function team(city, qb)
{
this.city = city;
this.qb = qb;
}
var Patriots = new team("New England", "Tom Brady");
var Ravens = new team("Baltimore", "Joe Flacco");
var Broncos = new team("Denver", "Peyton Manning");
var Seahawks = new team("Seattle", "Russell Wilson");
document.write("Seahawks: City - " + Seahawks.city + " Quarterback - " + Seahawks.qb + "<br>");
document.write("Ravens: City - " + Ravens.city + " Quarterback - " + Ravens.qb + "<br>");
document.write("Broncos: City - " + Broncos.city + " Quarterback - " + Broncos.qb + "<br>");
</script>
<!-- END JAVASCRIPT -->
</body>
</html>