size attribut on a jQuery input object

size attribut on a jQuery input object

Hi all,

I'm currently trying to use javascript as an object language and so I'm doing something like this :

  1. _inputNameExp = jQuery('<input/>', {'type': 'text', 'size': '25});
  2. $('body').append(_inputNameExp);

This partially works : input is created and inserted in the body but there is no "size" attribute...

A workaround is :
  1. _inputNameExp.attr('size', '25');
And now this is working but I don't like it...


Am I doing something wrong during the input creation ?
Is this a jQuery bug ?

Thanks !

Also I apologize for my english and hope someone will understand my question and try to help me...