IT. Expert System.

JQUERY

val()


Description

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

Note: This function is mostly used with form elements.


Return the Value Attribute

Returns the value of the value attribute of the FIRST matched element.

v1.0

This method has the form:

.val()

Return Value

This form returns a String, Array object.


Set the Value Attribute

Sets the value of the value attribute for ALL selected elements.

v1.0

This method has the alternate form:

.val(value)
Parameter Description
value Specifies the value of the value attribute

Return Value

This form returns a jQuery object.


Set the Value Attribute Using a Function

Using a function to set the value of the value attribute for all selected elements.


v1.4

This method has the alternate form:

.val(function(index,oldvalue))
Parameter Description
function(index,
oldvalue)
Specifies a function that returns the value to set.
  • index - (optional) Receives the index position of the selector
  • oldvalue - (optional) Receives the current value attribute of the selector

Return Value

This form returns a jQuery object.

Examples

Set the value of an input field:

$("button").click(function(){
  $("input:text").
    val("John Q. Public");
});


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 209 / 158797897. Delta: 0.00370 с