Net-informations.com
SiteMap  | About    

jQuery val() Method



jQuery offers various methods for manipulating the HTML and CSS. The jQuery val() method operates on the input value (the text entered or item selected) .val() actually serves two functions — get the current value of the first element in the set of matched elements or set the value of every matched element.

Get the Values of Text Fields with val() method

Set the Values of Text Fields with val() method

run this source code Try it Yourself


Full Source

When do I use .val() vs .html?

The .val() method is used to get/replace input elements values in jQuery while .html() method is used to get/replace the whole markup inside an element, not input elements.









net-informations.com (C) 2018    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.