-3

I can get the element like this $("#name") but I'm not sure how to get the actual value.

Utkarsh Dixit
  • 4,153
  • 3
  • 14
  • 36

2 Answers2

0

Use .val()

$('#name').val();

The above is getter and to set, do the below:

$('#name').val('yourname');
Amit Joki
  • 56,285
  • 7
  • 72
  • 91
0

It is very simple, use the val method of jquery.

$('#name').val();
Rashmin Javiya
  • 5,105
  • 3
  • 26
  • 48