LearnFrenzy
Sign in Take a free test

DOM Manipulation · DOM Manipulation MCQ · Question 9

Attribute vs property Answer, explanation & discussion

  • MCQ
  • Hard
  • 0 comments
  • Answer explained
  • Moderated community
Question 9 Back to Exercise

The user types "Ravi" into <input value="Asha">. What do input.value and input.getAttribute("value") return?

  • A "Ravi" and "Asha" Correct
  • B "Asha" and "Ravi"
  • C "Ravi" and "Ravi"
  • D "Asha" and "Asha"
Correct Answer: Option A

The value property is the live state; the attribute is the initial value from the HTML.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links