jQuery serialize() method
Example
Output the result of serializing form values:
$
(
"
button
"
)
.
click
(
function
(
)
{
$
(
"
div
"
)
.
text
(
$
(
"
form
"
)
.
serialize
(
)
)
;
}
)
;
Try it »
Definition and Usage
The serialize() method creates a URL-encoded text string by serializing form values.
You can select one or more form elements (such as input and/or textarea), or the form element itself.
The serialized values can be used in a URL query string when generating an AJAX request.
Syntax
$(
selector
).serialize()
jQuery AJAX methods