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:
Description | |
Set the value of the Value attribute. |
Use function to set value syntax: $(selector).val(function(index,oldvalue))
Parameters:
Description | |
Specifies a function that returns the value to be set. | |
Optional. Accepts the index position of the selector. | |
Optional. Accepts the selector's current Value property. |