Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

Jquery Setting Value of Input Field

by
Category:javascript
javascript jquery
Jquery Setting Value of Input Field

The val() method returns or sets the value attribute of the selected elements.

 To get a form value with jQuery use the val() function. Let's say we have a form like this, using an id for each form element.

HTML Code

<input id="userName" name="userName" type="text" value=""/>

jQuery Code

$("#userName").val("bladephp")

Empty Value

$("#userName").val("")

0 Comments


Html code work in comment box


Related Post