Objects and the DOM Flashcards
how do we create an object dictionary?
var name = {key: Value, key: Value, key: Value}
How do we call upon an object and it’s key?
console.log(name.key);
How do we had key and values to an existing object? How do we overwrite existing information?
name.key = value; we can also overwrite by calling the same key
give more description of the DOM
Document is a big container, inside of which sits information (properties) and instructions (methods). You can access these objects for example the body by calling document.body in the console.
Fetching the object requires you to use a built-in mthod such as getElementsByTagName (e.g. document.getElementsByTagName(‘div’)) . This will return an array of DOM elements.
What are front-end frameworks or libraries?
By layering some functionality atop regular JavaScript, the DOM becomes much easier to manipulate. That means faster development and hopefully a better end product. In the MEAN stack, we’ll learn about one of these: AngularJS.
What is the DOM?
Copy of your code in the browser. Users can manipulate this with JQuery, but doesn’t change the SOURCE CODE.
User goes to your webpage, he may not speak english , but you still want to make it available.
When you interact with the website the DOM changes not the code…