Q. Consider the below code:
Identify the correct code in order to fetch the value entered in username text field?

Code:
< body>
< form name="login">
Enter Your Name< input value="Akash" id="p_name" name="uname">
< /form>
< /body>
  • (A) document.getElementByName ("name").value
  • (B) document.login.uname.value
  • (C) document.getElementById ("p_name").value
  • (D) Both B and C
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both B and C

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
237
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
80%
Success Rate