BrokeMyLegBiking BrokeMyLegBiking -5 years ago 170
jQuery Question

jquery to serialize only elements within a div

I would like to get the same affect as jQuery.serialize() but I would like to return only the child elments of a given div.

sample result:


Answer Source

No problem. Just use the following. This will behave exactly like serializing a form but using a div's content instead.

$('#divId :input').serialize();

Check for a demonstration ( for the code)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download