Q. Consider the below code:
Identify the correct code in order to fetch the value entered in username text field?
Code:
Identify the correct code in order to fetch the value entered in username text field?
< body> < form name="register"> Enter username < input value="John" id="name" name="username"> < /form> < /body>
β
Correct Answer: (B)
document.getElementById ("name").value