PrepAway - Latest Free Exam Questions & Answers

Which of the following lines of code should you use to complete the code?

You work as a developer at ABC.com. The ABC.com network consists of a single domain named
ABC.com. You make use of CSS3 and HTML5 for development purposes.
You are in the process of creating a dynamic web form that contains a checkbox input type. You
want to make sure that an input text box is dynamically added to the form when the check box is
ticked.
You have started to write the required code as shown below:

Function ShowInputBox (divName)
{
Var newInputDiv = document.createElement (‘div’);
Which of the following lines of code should you use to complete the code?

PrepAway - Latest Free Exam Questions & Answers

A.
newInputDiv.innerHTML = “<input type=’text’ id=’newInputBox’>”;
document.getElementById(divName).appendChild(newInputDiv);
}

B.
newInputDiv.innerXML = “<input type=’text’ id=’newInputBox’>”;
document.getElementById(Name).appenChild(Input);
}

C.
newInputDiv.outerXML = “<input type=’text’ id=’newInputBox’>”;
document.getElement (divName).appenChild(newInputDiv);
}

D.
newInputDiv.outerHTML = “<input type=’text’ id=’newInputBox’>”;
document.getElementById(divName).appenChild(newInputDiv);
}

Explanation:


Leave a Reply