• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Quiz

Test your knowledge of JavaScript's advanced DOM features by answering the following questions.

Questions

  1. If para1 is the DOM object for a paragraph, what is the correct syntax to change the text within the paragraph to “New Text”?

    1. para1.value="New Text";

    2. para1.firstChild.nodeValue="New Text";

    3. para1.nodeValue="New Text";

  2. Which of the following is the correct syntax to get the DOM object for a heading with the identifier head1?

    1. document.getElementById("head1")

    2. document.GetElementByID("head1")

    3. document.getElementsById("head1")


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint