PrepAway - Latest Free Exam Questions & Answers

Which line of JavaScript code should Nadir use to refer to the value in the form field?

Nadir wants to add JavaScript to the company Web site. He wants to reference the value that is
entered into the following form field: <FORM NAME=”hrsForm”> <INPUT TYPE=”text”
NAME=”myName”> </FORM> Which line of JavaScript code should Nadir use to refer to the value
in the form field?

PrepAway - Latest Free Exam Questions & Answers

A.
document.hrsForm.myName.value;

B.
document.hrsForm[0]. myName [0].value;

C.
document.form[0].element[0].value;

D.
document.hrs[0].myName [0].value;


Leave a Reply