val

##UK [væl] US [væl]

n. British pressure unit, equal to 10N/M; gram equivalent

jquery val() method syntax

Function:val() method returns or sets the value of the selected element. The value of an element is set via the value attribute. This method is mostly used for input elements. If this method does not set parameters, it returns the current value of the selected element.

Syntax:$(selector).val(value)

Parameters:

Parameters Description
value Optional. Specifies the new content of the selected element.

#Return value:Return the value of the value attribute of the first matching element.

Syntax:$(selector).val()

Set value syntax:$(selector).val(value )

Parameters:

##Parameter Description value Set the value of the Value attribute.

Use function to set value syntax:$(selector).val(function(index,oldvalue))

Parameters:

jquery val() method example

    

Name:

Run instance »

Click the "Run instance" button to view the online instance

About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!
Parameter Description function(index,oldvalue) Specifies a function that returns the value to be set. index Optional. Accepts the index position of the selector. oldvalue Optional. Accepts the selector's current Value property.