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?

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?

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 0

Your email address will not be published. Required fields are marked *