jQuery Tutorial Tutorials - jQuery .serializeArray()

jQuery .serializeArray()

The .serializeArray() method in jQuery is used to encode a set of form elements as an array of names and values.

jQuery .serializeArray() syntax

.serializeArray()

jQuery .serialize() VS .serializeArray()

The output of serialize() is a string,
The output of serializeArray() is an array

jQuery .serializeArray() example

example

$( "form" ).on( "submit", function( event ) {
  event.preventDefault();
  console.log( $( this ).serializeArray() );
  // output is an array
});

Try now

Date:2019-08-30 03:05:11 From:www.Lautturi.com author:Lautturi