dom-creation Flashcards
Does the document.createElement( ) method insert a new element into the page?
No.
How do you add an element as a child to another element?
Using AppendChild( ) method.
What do you pass as the arguments to the element.setAttribute( ) method?
Attribute name and attribute value.
What steps do you need to take in order to insert a new element into the page?
Create the element and then append it to the document.
What is the textContent property of an element object for?
Property thats gets and sets the text content of an element.
Name two ways to set the class attribute of a DOM element.
setAttribute( ) method and className property.
What are two advantages of defining a function to create something (like the work of creating a DOM tree)?
To not repeat yourself and automation.