Question 11 What output will be displayed on the document when the following loop completes? for(x=0; x<4; x++){ document.write(x*2 + " "); } XX XXXX XX 0246 O 012345678 O2468 Question 12 Write a JavaScript statement that retrieves the element with the value 43 from the array myNums? var myNums = [78, 43, 212, 42, 2, 41];
Question 13 Which of the following statements invokes a function named doSomething that accepts a boolean parameter? doComething true; doSomething(true); doSomething<-(true); doSomething[true];
Question 14 Which of the following statements defines a function named square that returns a value and defines a parameter? square(num){ num*num; } return num; num*num; return num; } square(num){ } num*num; return num; function square(num) } func square(){ param: num; num*num; return(num):
Question 15 Which of the following statements creates a variable to store a list of all elements with a class of "cool"? var cool = document.getElementList("cool"); var cool = document.class("cool"); var cool = "document.getClassList("cool"); var cool = document.getElementsByClassName("cool"); Question 16 Which of the following statements sets a function called doStuff to be called when myText is clicked? myText.onClick=doStuff(); myText.click=doStuff; myText.onClick(doStuff); myText.onclick=doStuff; ↑ TOP
Question 17 1점 가능 (채정됨) Which of the following statements creates a function to handle an onload event? element.onload({ alert("Hello"); } } } } element.onload() = (X element.onload = function(){ element.onload = func{ alert("Hello"); alert("Hello"); alert("Hello");
Question 18 Which of the following statements adds a new <p> element (myPara) to the end of an <article> element (myArticle)? myArticle.add(myPara); myArticle.appendChild(myPara); myArticle += myPara; myArticle.addChild(myPara); Question 19 Which of the following statements inserts a list item (myLI) as the first element in a list (myList)? Assume items is an array containing the children of myList myList.insertBefore(myLi, items[0]); myList.insertFirst(myLI); myList.putFirst(myLI); myList[0] = myLl; O
Question 20 Which of the following statements would move an image element (mylmage) from it's original location in the DOM to be within an article (myArticle)? O myArticle.appendChild(mylmage); O myArticle.move(mylmage); O myArticle.move(mylmage); mylmage.parent = myArticle;
Question 11 What output will be displayed on the document when the following loop completes? for(x=0; x<4; x++){ documen
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am