Javascript and the DOM Flashcards
When the browser loads a web page, it creates what 2 objects?
Window and document
Window
gives you access to information about the current browser window, including it’s document, location, and the global scope
Document (Object Model)
an API that gives you access to all HTML nodes
clear()
clears the DOM screen
What are the correct ways to access the document?
- window.document
- document
The _____ object contains everything, it’s the global object.
window
If you have a cat object and it has a method of meow() how would you call it?
cat.meow()
If you have a cat object and it has a property of age how would you access it?
cat.age
API
- Application Programming Interface
- a set ofroutines, protocols, and tools for building software applications
What are 3 types of actions we can do to the DOM?
- Manipulation
- where we manipulate elements
- Events
- listening to a specific event, like a mouse click or a key press, and have something execute
- Traversal
- selecting an element based on the relationship with another element
- for example. we could select a chiled element of a known parent element like a list item child of an unordered list
4 P’s of Problem Solving
- Prepare
- Plan
- Perform
- Perfect
The DOM stands for: _____
Document Object Model
Is the DOM part of the JavaScript language?
No, the DOM is an API for the browser
What browser tool lets you experiment with JavaScript code by writing a single line at a time?
JavaScript Console