Skip to content
Related Articles

Related Articles

jQuery | serialize() with Examples
  • Last Updated : 13 Feb, 2019

The serialize() method is an inbuilt method in jQuery which is used to create a text string in standard URL-encoded notation. This method can act on a jQuery object that has selected individual form controls, such as input, textarea etc.



Parameters: This method does not contain any parameter.

Return Value: This method returns a string of a object for the selected element.

Below example illustrates the serialize() method in jQuery:


<!DOCTYPE html>
        <title>serialize Method</title>
        <script src=
        <!-- jQuery code to show the working of this method -->
            $(document).ready(function() {
                $("button").click(function() {
            #d1 {
                width: 300px;
                height: 100px;
                padding: 20px;
                border: 2px solid green;
                margin-bottom: 10px;
        <div id="d1">
            <form action="">
                Site Name:
                <input type="text" name="SiteName" value="GeeksforGeeks">
                <br> Contributor name:
                <input type="text" name="ContributorName" value="geeks">
            <!-- click on this button -->
            <button>Click here!</button>
        <div id="d"></div>

serialize method


My Personal Notes arrow_drop_up
Recommended Articles
Page :