¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

JavaScript Dom and Events

Junaid Khan 60 preguntas Actualizado el 4 dic 2017

Hacer el test

Este test tiene tiempo límite, así que se abre en el reproductor de siempre.

Preguntas del test (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

Información

Descripción
EECS 1012- Test sobre JavaScript Dom and Events, creado por Junaid Khan el 03/12/2017.
Idioma
English
Visitas
1
Historial
Creado el 3 dic 2017 · actualizado el 4 dic 2017
Etiquetas
eecs 1012-
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?