title: Jquery - SerializeArray() by ID
body: <p>I have this problem, I use serializearray() jquery for serialize all fields of Form to Json.
  It works fine if in the input I put the name attribute, but if I'd like to put only the ID attribute It doesn't work.</p>
  
  <p>The good function by name [name is similar: '#myformnameid']:</p>
  
  <pre><code>function formToJson(nameForm)
  {
   var jsonForm={};
   var queryFrom = $(nameForm).serializeArray();
  
   for (i in queryFrom) {
     jsonForm[queryFrom[i].name] = queryFrom[i].value;
    }
   return jsonForm;
  }
  </code></pre>
  
  <p>I tried for ID solution with attr.</p>
  
  <pre><code>function formToJson(nameForm)
  {
   var jsonForm={};
   var queryFrom = $(nameForm).serializeArray();
  
   for (i in queryFrom) {
     jsonForm[queryFrom[i].attr("id")] = queryFrom[i].value;
    }
   return jsonForm;
  }
  </code></pre>
  
  <p>Any Idea?</p>