Hot to map html input properties to object with jQuery?
<p>I want to read all page inputs ids and values
into object and pass it to function which loop throuhg them and extract id and value.</p>

<p>I started with:</p>

<pre><code>function send()
{
var data = [];
var inputs = $(":text");
for (var i = 0, l = inputs.length; i &lt; l; i++) {
   var input;
   input.id = inputs[i].attr("id");
   input.text = inputs[i].val();
   data[i] = input;
}
receive(data);
}

function receive(data)
{
    for (var input in data) {
        alert(input.id);
        alert(input.text);        
    }
}
</code></pre>

<p>Why this does not work?</p>
