dom-creation Flashcards
Does the document.createElement() method insert a new element into the page?
no it does not
How do you add an element as a child to another element?
appendChild()
What do you pass as the arguments to the element.setAttribute() method?
key and value
What steps do you need to take in order to insert a new element into the page?
create it then append it
What is the textContent property of an element object for?
to get or set the text content of that element
Name two ways to set the class attribute of a DOM element.
setAttribute() or className
What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?
You do not need to repeat yourself for the code