jQuery serialize()Method

jQuery AJAX 方法jQuery AJAX Methods

Examples

Output the result of serialized form values:

$("button").click(function(){ $("div").text($("form").serialize()); });

Try it Yourself »

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 inputs and/or text areas), or the form element itself.

The serialized values can be used in the URL query string when generating AJAX requests.


Syntax

$(selector).serialize()


jQuery AJAX 方法jQuery AJAX Methods

Other Extensions