CodesJava

Easy learning with example program codes

jQuery serialize()


Some important features of jQuery serialize() method are;

  • jQuery serialize() method creates a text string in standard URL-encoded notation.
  • It is used in form controls.
  • It serializes the form values, the serialized values can then be used in the URL query string.

Syntax:

$ (selector).serialize()  

Example

<!DOCTYPE html>  
<html>  
<head>  
 <script src="https://code.jquery.com/jquery-1.10.2.js"></script>  
<script>  
$(document).ready(function(){  
 $("button").click(function(){  
 $("div").text($("form").serialize());  
 });  
});  
</script>  
</head>  
<body>  
<form action="">  
  First name: <input type="text" name="Mailid" value="test.com"><br>  
  Last name: <input type="text" name="UserName" value="Jai"><br>  
</form>  
<br>
<button>Serialize</button>  
<br>
<div></div>  
</body>  
</html>

Try it

JS Bin on jsbin.com

Sign Up/ Sign In
Ask a Question


Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at hr@codesjava.com.

Development

We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on hr@codesjava.com.

Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki