1.3 - The DOM Flashcards
En qué nos ayuda el DOM
Nos permite interactuar con un document HTML
Técnicamente, que es el DOM
es una API por cada HTML, como también documentos XML, y SVG. Nos ofrece una representación en forma de objetos en un árbol
With the DOM, programmers can… ?
Build documents Navigate their structure Add, modify, delete elements and content.
Web Browsers, uses the DOM, for what?
Use the DOM specifications to determine how they will display the web pages
When we load a web page in the browser, what happens behind the scenes?
The browser is taking the HTML document sent from the server, and converting it into the DOM
Any language can interact with the DOM?
Yes, the DOM is language agnostic.
For what purpose we use JS with the DOM?
As a way to access and interact with elements on a Web Page
In the DOM, everything is made up of what things?
NODES
What are the “NODES”?
Objects that are then made into trees
What nodes have, as objects has?
properties and methods
How many node types exists, that are related to our purpose?
6
Name the 6 nodes types ir numeric order
1 - Element
3 - Text
8 - Comments
9 - Document
10 - DocumentType
11 - DocumentFragments
The node type Document What identification number it has, and what is his purpose?
number: 9 It is the HTML document itself
The node type DocumentType What identification number it has, and what is his purpose?
number: 10 Handles the Doctype. e.g. for HTML5 documents.
The node type Element What identification number it has, and what is his purpose?
number: 1 Element nodes, quite common, represent all of the HTML elements on a page.
The node type Text What identification number it has, and what is his purpose?
number: 3 text values(valores de texto) often found inside node elements or attributes.
Node types and Node elements are the same?
NO
The node type Comments What identification number it has, and what is his purpose?
number: 8 HTML comments
The node type DocumentFragments What identification number it has, and what is his purpose?
number: 11 Collection of nodes, often used for inserting a group of elements or text nodes together into a document.
Attributes elements are nodes in their own right?
NO, that was in the past, from DOM 4, attributes will no longer be nodes in the same way.
There is any way in the browser to see the DOM represented as a tree like fashion?
NO, but it´s quite common to picture it or imagine it like a “tree like” for learning purposes
There will be some text nodes that contain white spaces?
YES