Question 11 getElementsByClassName() is not supported by Microsoft until IE9 Tru
ID: 3810935 • Letter: Q
Question
Question 11
getElementsByClassName() is not supported by Microsoft until IE9
True
False
2.5 points
Question 12
Adding a new node to the DOM tree requires 2 steps. Which 2?
createChild()
createElement()
appendElement()
appendChild()
2.5 points
Question 13
If the following code were placed in a style sheet, #hottag would be a CSS _____.
.caution {font-size: 12pt; color: blue;}
#hottag {width: 620px;}
tag selector
ID selector
class selector
class property
2.5 points
Question 14
The form tag's method attribute ____.
determines the URL the form is submitted to
determines how form data is submitted
determines if cookies are encrypted or not
determines whether the form submission occurs or not
2.5 points
Question 15
You have 6 radio buttons all with the name radColor on a html form named f1. If the user checks the last radio button listed, what is the value of x after this code runs?
for(var i=0; i<6; i++) {
if(document.f1.radAge[i].checked == true) {
var x = i;
}
}
4
5
0
6
3.5 points
Question 16
The ____ method returns the first element in a document with a matching id attribute.
getElementByTab()
getElementByName()
getElementById()
getElementByIdTag()
2.5 points
Question 17
"If a HTML select element (a drop-down list) displays only a single option, then the item at index 1 is selected by default."
True
False
2.5 points
Question 18
"The options for a HTML select list are ordered like an array, with the first option being at index 0, the second option at index 1, and so on."
True
False
2.5 points
Question 19
The ____ property of the Image object allows JavaScript to dynamically change an image.
img
src
path
file
2.5 points
Question 20
Which of the following return an array? Choose all that apply.
getElementById()
getEementsByTagName()
getElementsByName()
getElementsByClassName()
2.5 points
Question 21
"You want a submitted form to be validated before submittion, the form is to be submitted using a submit button, and you use the onsubmit() event handler of the form tag to call the function that validates the HTML form. So _____."
such an approach would never work in a million years
the validation function that is called must return either true or false
2.5 points
Question 22
The _____ DOM method allows inserting a new DOM node before an existing DOM element.
setAttribute()
insertBefore()
appendChild()
addFirst()
2.5 points
Question 23
Which of the following would create a new script element?
createElement("script").value = x;
x = createElement("script");
document.createElement = "script";
x = document.createElement("script");
3.5 points
Question 24
The form tag's _____ attribute determines the URL of the page on the web server that a form is submitted to.
accept-charset
enctype
method
action
2.5 points
Question 25
The _____ DOM method puts a created element into the DOM as the last child of the parent node.
setAttribute()
insertBefore()
appendChild()
append()
2.5 points
Question 26
"If an element has a default action, the event handler for that element runs before the default bahavior occurs."
True
False
2.5 points
Question 27
"When you have a group of radio buttons or checkboxes, you can use the ____ property to determine which element or elements in the group is selected."
value
size
checked
option
2.5 points
Question 28
You have a form named f1 and a textbox in that form named txtName. What happens when the if-block executes?
if(document.f1.txtName.value != "")
the test is true if the user has typed something in the textbox.
the test is false if the user has not typed something in the textbox.
3.5 points
Question 29
Using a select list with an id of "toppings", you can get the selected option value using ____.
opt = document.getElementbyId("toppings").value;
"opt = document.getElementbyId("toppings") {value};
opt = document.getElementbyId("toppings")[value];
opt = document.getElementbyId("value");
2.5 points
Question 30
____ allows JavaScript to store and retrieve an image from memory rather than download the image each time it is needed from the web server.
Image refreshing
Image caching
Image quick loading
Double buffering
2.5 points
Question 31
"If a CSS property is called font-weight, what would the corresponding javaScript reference be?"
fontWeight
font.weight
font-Weight
FontWeight
2.5 points
Question 32
In a style sheet, #sidebar and .caution, as shown below, would be called CSS _____.
<style>
.caution {font-size: 12pt; color: blue;}
#sidebar {width: 620px;}
</style>
tokens
selectors
labels
markers
Question 33
The _____ DOM method allows removing a node
removeChild()
removeItem()
deleteItem()
deleteChild()
createChild()
createElement()
appendElement()
appendChild()
Explanation / Answer
Answer 11:
True , it was supported untill IE8
Answer 12 :
create element and append child
var para = document.createElement("p"); here i am creatting element p and storing it into variable para .
var node = document.createTextNode("This is a new paragraph."); // here i am creating a text node and storing it into var node.
para.appendChild(node); // and here i am appending the child
Answer 13 :
Id selector
tag {} is a tag selector. #id {} is an id selector. .class {} is a class selector. There is no such thing as class property.
Answer 14:
determines the URL the form is submitted to
form tag has two methods :
get and post
post is used as http request
but in get method data is appended in the url and visible to any one
Answer 15:
5 , As array index starts from 0 in most of the languages if u have 6 controls with same name , it mean u have cont0,,, til cont5
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.