From 4d9bcfc803f067e0c8ca607900573805b09d0b13 Mon Sep 17 00:00:00 2001 From: Suraaj Shrestha <suraaj.shrestha@du.edu> Date: Wed, 18 Oct 2017 12:42:08 -0600 Subject: [PATCH] Lab10 --- Lab10/Lab10.html | 88 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 Lab10/Lab10.html diff --git a/Lab10/Lab10.html b/Lab10/Lab10.html new file mode 100644 index 0000000..54f1874 --- /dev/null +++ b/Lab10/Lab10.html @@ -0,0 +1,88 @@ +<html> + <head> + <meta charset="utf-8"> + <title> Lab10s + </title> + <body onclick="labFunction();"> + <script> + + function Personal(name, age, displayPersonal) + { + this.name = name; + this.age = age; + this.displayPersonal = displayPersonal; + } + + var name1 = new Personal('Sebastian',19, function() + { + var result = 'My name is ' + this.name + ' and I am ' + this.age +' years old'; console.log(result); + } + ); + name1.displayPersonal(); + + Personal.prototype.gender = 'male'; + Personal.prototype.occupation = 'student' + var name2 = new Personal('Shawn','23', function() + { + var result = 'My name is ' + this.name + ' and I am ' + this.age +' years old ' + this.gender +' '+this.occupation; console.log(result); + } + ); + name2.displayPersonal(); + + + + var Person = + { + name: ['Messi', ' Lionel'], + teams: + { + team1:"FC Barcelona", + team2:"Argentina Football National Team" + }, + security: + { + + }, + displayName: function() + { + console.log(this.name +' '+this.teams.team2); + } + }; + + var Person1 = Object.create(Person); + Person1.displayName(); + + var Person2 = Object.create(Person); + Person2.name = 'Maradona'; + Person2.displayName(); + + + + var Answers = prompt('Enter your ID'); + security = Answers; + console.log(Answers); + + + window.alert("An Alert"); + window.confirm("Confirmation Box"); + + function labFunction() + { + console.log("on click"); + } + + window.onblur = function() + { + console.log('blur event'); + } + + function focusFunction() + { + console.log("focus event"); + } + window.addEventListener("focus", focusFunction); + + </script> + </body> + </head> +</html> -- GitLab