-3

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

Utkarsh Dixit
  • 4,267
  • 3
  • 15
  • 38

2 Answers2

0

Use .val()

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

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

$('#name').val('yourname');
Amit Joki
  • 58,320
  • 7
  • 77
  • 95
0

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

$('#name').val();
Rashmin Javiya
  • 5,173
  • 3
  • 27
  • 49