PrepAway - Latest Free Exam Questions & Answers

Which function should you use?

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?

PrepAway - Latest Free Exam Questions & Answers

A.
Option A

B.
Option B

C.
Option C

D.
Option D

2 Comments on “Which function should you use?

  1. carol says:

    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.




    0



    0

Leave a Reply