Latest web development tutorials

jQuery serializeArray () method

jQuery AJAX Methods jQuery AJAX Methods

Examples

Output in the form of an array of serialized form values ​​result:

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

try it"

Definition and Usage

serializeArray () method serialized form values ​​to create an array of objects (name and value) of.

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


grammar

$(selector).serializeArray()


jQuery AJAX Methods jQuery AJAX Methods