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?

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?

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 0

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