You are developing a web form that includes the following code.
When a user selects the check box, an input text box must be added to the page dynamically.
You need to ensure that the text box is added.
Which function should you use?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
The answer to this is B. You can check it with a text editor on w3schools.com or notepad++
To add a new element to the document you need to use the appendchild() method , either you append it to the body or to another element as a result you need to look at the first two answers. Next notice that in ‘A’ the element being referenced is the element which is already being created , this is the problem. B is correct because it uses the correct method and the correct flow of referencing the already existing element which is received through the parameters of the method and appending the new element to it.