1. Home
  2. Computer Science MCQs
  3. Jquery
  4. Which jQuery method gets the current value of a form input?

Added 2 Nov 2026

Which jQuery method gets the current value of a form input?

  1. .html()
  2. .text()
  3. .attr()
  4. .val() Correct answer

Correct answer

D. .val()

17 views

MCQSEXAM

Explanation

.val() reads or sets form field values. .text() and .html() read element content, and .attr('value') returns the initial attribute rather than the live value.

Reference

Asked in: Frontend Developer Tests, Technical Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Jquery MCQs

Practise all Jquery MCQs

Similar MCQs