From b85868bc5a7c35ed64180439a410ad8d897e1afa Mon Sep 17 00:00:00 2001 From: Jet Hughes Date: Tue, 26 Jul 2022 14:08:14 +1200 Subject: [PATCH] vault backup: 2022-07-26 14:08:14 --- content/notes/05-javascript.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/content/notes/05-javascript.md b/content/notes/05-javascript.md index 7b2706cca..7570bf0b9 100644 --- a/content/notes/05-javascript.md +++ b/content/notes/05-javascript.md @@ -9,4 +9,34 @@ tags: # Javascript ## DOM - JS can access and change all the elements of an HTML document -- When a webpage is loaded, the brow \ No newline at end of file +- When a webpage is loaded, the browser creates a DOM of the page +- The HTML DOM model is contructed as a tree of Objects + +![HTML DOM Diagram|300](https://i.imgur.com/2TZ2i1c.png) + +JS can: +- change elements +- change attributes +- change styles +- remove elements +- add new elements +- react to events +- create new events + +JS is +- descriptive +- structued +- interpreted + +can be linked externally +- `` +- `defer` ensures that the js is loaded after the html (in a specific order) +- `async` ensures that the js is run as soon as it is loaded (not in a specific order) + +typing + - js is dynamically typed + - you dont need to specify the type of variable + +events +- e.g., click, hover, etc +- \ No newline at end of file