generated from imd1005-web-development-winter-2023/assignment-03-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
44 lines (34 loc) · 762 Bytes
/
main.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
37
38
39
40
41
42
43
44
//
// JS File
// You may remove the code below - it's just boilerplate
//
//
// Variables
//
// Constants
const appID = "app";
const headingText = "To do. To done. ✅";
// Variables
// DOM Elements
let appContainer = document.getElementById(appID);
//
// Functions
//
// Add a heading to the app container
function inititialise() {
// If anything is wrong with the app container then end
if (!appContainer) {
console.error("Error: Could not find app contianer");
return;
}
// Create an h1 and add it to our app
const h1 = document.createElement("h1");
h1.innerText = headingText;
appContainer.appendChild(h1);
// Init complete
console.log("App successfully initialised");
}
//
// Inits & Event Listeners
//
inititialise();