jQuery serializeArray()

Some important features of the jQuery serializeArray() method are:

  • jQuery serializeArray() method creates a JavaScript array of objects.
  • One can select one or more form elements, as it operates on a jQuery collection of forms and form controls.
  • It serializes the form values.


$ (selector).serializeArray()


<!DOCTYPE html>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
var x = $("form").serializeArray();
$.each(x, function(i, field){
$("#results").append(field.name + ":" + field.value + " ");
<form action="">
First name: <input type="text" name="Mailid" value="test.com"><br>
Last name: <input type="text" name="UserName" value="Jai"><br>
<div id="results"></div>
Please follow and like us:
Content Protection by DMCA.com