dom-creation Flashcards
1
Q
Does the document.createElement() method insert a new element into the page?
A
it does not
2
Q
How do you add an element as a child to another element?
A
append.child method
3
Q
What do you pass as the arguments to the element.setAttribute() method?
A
what every attribute and whatever value you want
4
Q
What steps do you need to take in order to insert a new element into the page?
A
create it and then create
5
Q
What is the textContent property of an element object for?
A
you can just get it or even set it
6
Q
Name two ways to set the class attribute of a DOM element.
A
class attribute or classname
7
Q
What are two advantages of defining a function to do create something (like the work of creating a DOM tree)?
A
reusability