Show Menu
Cheatography

DOM Cheat Sheet (DRAFT) by

DOM

This is a draft cheat sheet. It is a work in progress and is not finished yet.

DOMElement

What DOMElement method should be used to check for availa­­bility of a non-na­mes­­paced attribute?

A. getAtt­­ri­b­u­teNS()
B. getAtt­­ri­b­ute()
C. hasAtt­­ri­b­ute()
D. hasAtt­­ri­b­u­teNS()
Answer : C

method

Which of the following is an invalid DOM save method?

A. save()
B. saveFile()
C. saveXML()
D. saveHTML()
E. saveHT­­ML­F­ile()
Answer : B
 

DOMElement

Which DOMElement property provides a reference to the list of the element's children?
Answer : childNodes

Method

What method can be used to find the tag <an­­y> via the DOM extension?

A. getEle­­me­n­t­ById()
B. getEle­­me­n­t­sB­­yTa­­gN­ame()
C. getEle­­me­n­t­sB­­yTa­­gN­a­m­eNS()
D. getEle­­me­n­t­By­­Name()
E. findTag()
Answer : B

method

What DOM method is used to load HTML files?

A. load()
B. loadXML()
C. loadHTML()
D. loadHT­­ML­F­ile()
Answer : D

method

What DOM method is used to load HTML files?

A. load()
B. loadXML()
C. loadHTML()
D. loadHT­­ML­F­ile()
Answer : D