Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

jQuery serializeArray() Method

❮ jQuery AJAX Methods

Example

Output the result of form values serialized as arrays:

$("button").click(function(){
  var x = $("form").serializeArray();
  $.each(x, function(i, field){
    $("#results").append(field.name + ":" + field.value + " ");
  });
});
Try it Yourself »

Definition and Usage

The serializeArray() method creates an array of objects (name and value) by serializing form values.

You can select one or more form elements (like input and/or text area), or the form element itself.


Syntax

$(selector).serializeArray()

❮ jQuery AJAX Methods