Question: I haven't found a concrete answer as to whether this is possible, but it seems like it should be...

I would like to serialize all the input elements contained in a div. I can't use a form, because it would be nested within another form. I would then get the values and post them via ajax.

Here is the jsFiddle example I am playing with:

<http://jsfiddle.net/9uyz5/>

If I change the root to a it works as expected.

Thanks for your help.

I've modified the jsfiddle from this other question:

<https://stackoverflow.com/a/1186309/25020>

Answer: 
you need to serialize all the inputs inside your container, not the actual container itself. so:

```
$('div :input').serialize()

```
For serializing the contents of the div with a button, this will be the more efficient way as it doesn't traverse through the entire dom.

`$(this).closest('div').find("input,select,textarea").serialize();`

make sure to attach this with the button event and make sure to include [event.preventdefault](http://api.jquery.com/event.preventdefault/) with the button so that it does not submit the primary form if the div is inside it.