if you want to add more attributes just do like:
$('<input>').attr('type','hidden').attr('name','foo[]').attr('value','bar').appendTo('form');
Or
$('<input>').attr({
type: 'hidden',
id: 'foo',
name: 'foo[]',
value: 'bar'
}).appendTo('form');