JQuery Serialize()

jQuery serialize() method is the used to encode a set of form elements as a string for submission.

It creates a text string in standard URL-encoded notation. It can act on a jQuery object that has selected individual form controls, such as <input>, <textarea>, and <select>: $("input, textarea, select").serialize();

Below the syntax of serialize().


<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>jQuery serialize()</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
$(document).ready(function() {
  $("#button").click(function() {
   <form name="" id="">
     <p>First Name <input type="text" name="first_name" value="" /gt;</p>
     <p>Last Name <input type="text" name="last_name" value="" /gt;</p>
 <button style="margin:0 0 10px 0;background:#e8e8e8;" class="btn" id="button">Serialize</button><br /><br />
 <div id='serialize'></div>