Tag Archives: jquey val method

jQuery val Method


jQuery val method : is used to get and set value in form fields.


Syntax of jQuery val() method

Get Value

$(selector).val();

Note : It does not accepts any argument.
It is used to get form field value.

jQuery val Method Example 1

jQuery val() Method – Example 1 – Get The val


Try it »

Set Val

$(selector).val(value);

value:value to be set.

jQuery val method Example 2

jQuery val() Method – Example 2 – Set The val/h3>


Try it »