-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
36 lines (29 loc) · 855 Bytes
/
script.js
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
document.addEventListener("DOMContentLoaded", () => {
const btn = document.querySelector("#this");
btn.addEventListener("click", () => appendThis());
const thisDiv = document.querySelector("#whatThis");
function appendThis() {
let vidEl = document.createElement("iframe");
vidEl.src = "https://www.youtube.com/embed/aSAuddBgyMs";
vidEl.width = "400";
vidEl.height = "300";
thisDiv.appendChild(vidEl);
}
});
class WhatThis {
whatisthis() {
console.log(this);
return this;
}
}
let zis = new WhatThis();
zis.whatisthis();
function ConstructThis(name) {
this.name = name;
this.whatDis = function(name) {
console.log(`Hello ${name}, this is ${this}`);
};
}
let instance = new ConstructThis("Person");
instance.whatDis(this);
console.log(`View source here: ${"https://github.com/SamCatherman/this"}`);