Serialize method in jQuery
The serialize() method is an inbuilt method in jQuery which is used to create a URL encoded text string by serializing form values. This method can act on a jQuery object that has selected individual form controls, such as input, textarea etc. or the form element itself.
Only form elements are examined for inputs they contain, in all other cases the input elements to be serialized should be part of the set passed to the .serialize() method . Selecting both the form and its children in a set will cause duplicates in the serialized string.