GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

JavaScript Dom and Events

Junaid Khan 60 Fragen Aktualisiert am 4 Dez 2017

Quiz starten

Dieses Quiz hat ein Zeitlimit und öffnet sich deshalb im gewohnten Player.

Fragen in diesem Quiz (60)

  1. 1Consider the following HTML and JS code. What is the value of pars.length?
    <body>
    <p> Paragraph 1 </p>
    <div id="myDiv">
    <p> Paragraph 2 </p>
    </div>
    </body>
    var myDiv=document.getElementById("myDiv");
    var pars=myDiv.getElementsByTagName("p");
    1. A0
    2. B2
    3. C1
    4. D3
  2. 2Consider the following HTML and JS code. What is the value of pars.length?
    <body>
    <p> Paragraph 1 </p>
    <div id="myDiv">
    <p> Paragraph 2 </p>
    </div>
    </body>
    var myDiv=document.getElementById("myDiv");
    var pars=document.getElementsByTagName("p");
    1. A0
    2. B1
    3. C3
    4. D2
  3. 3In the Prototype library, the $("p") function is equivalent to?
    1. Adocument.createElement("p");
    2. Bdocument.getElementsByTagName("p");
    3. Cdocument.getElementById("p");
    4. Ddocument.getElementByTagName("p");
  4. 4In JavaScript, does the DOM tree include the head section of the HTML page?
    1. AYes
    2. BNo
  5. 5Based on the following JS code which variable is local scoped?
    var a=10;
    function myFunc() {
    var c=document.getElementById("myPar");
    }
    1. Adocument
    2. Ba
    3. Cc
    4. Dboth a and c
  6. 6var myP = document.getElementById("myP");
    myP.children[1].style.backgroundColor = "silver";
    1. ASets the background color to silver of the third child of element id="myP"
    2. BSets the background color to silver of the first child of element id="myP"
    3. CModifies all children of elemetn id="myP"
    4. DSets the second child of element id="myP" background to silver
    5. ESets the element id="myP" background to silver
  7. 7In Javascript, if you wanted to set a timer that calls function "myFunc" every second, which statement would you use?
    1. AsetInterval(1000, myFunc);
    2. BsetRepeat(myFunc, 1000);
    3. CsetInterval(myFunc, 1000);
    4. DsetTimeout(myFunc, 1000, REPEAT);
    5. EsetTimeout(myFunc, 1000);
  8. 8In JavaScript, what command can be used to remove a node from the DOM tree?
    1. Adocument.deleteChild(...)
    2. Bdocument.removeChild(...)
    3. Cdocument.killChild(...)
    4. Ddocument.unappendChild(...)
  9. 9Consider the following HTML code as a DOM tree:
    <div id="myDiv>
    <h1> Hello </h1>
    <p> This is a test. </p>
    <p> This is only <a myid="a" href=""> a test. </a> </p>
    <p> There will be one more test. </p>
    </div>

    Is the element myid="a" a child of the div element?
    1. Ayes
    2. Bno
  10. 10Consider the following HTML code as a DOM tree:

    <div id="myDiv">
    <h1> Hello </h1>
    <p> This is a test. </p>
    <p> This is only <a href=""> a test. </a> </p>
    <p> There will be one more test. </p>
    </div>
    Is the h1 element an ancestor of the element <a>?
    1. Ayes
    2. Bno

Informationen

Beschreibung
EECS 1012- Quiz am JavaScript Dom and Events, erstellt von Junaid Khan am 03/12/2017.
Sprache
English
Aufrufe
1
Verlauf
Erstellt am 3 Dez 2017 · aktualisiert am 4 Dez 2017
Schlagwörter
eecs 1012-
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck