$('#one').attr({ 'name': 'two', 'id': 'two' });
On Jun 4, 8:24 am, oscar esp <[EMAIL PROTECTED]> wrote: > Sorry I did a mistake when I copied te code. I have the code like > > jQuery("#"+inputID,addedItem).attr("id",newInputID); -> works ok > jQuery("#"+newInputID,addedItem).attr("name",newInputID); -> doens't > work.... > > On 4 jun, 13:25, arnaud sellenet <[EMAIL PROTECTED]> wrote: > > > If your code is exactly that (the two lines one after the other), > > this is normal the second one does not work, as $("#"+inputID) does > > not exist anymore... > > Did you try this : > > > > jQuery("#"+inputID,addedItem).attr("id",newInputID); > > > jQuery("#"+newinputID,addedItem).attr("name",newInputID); > > > or > > > > jQuery("#"+inputID,addedItem).attr("id",newInputID).attr > > > ("name",newInputID); > > > ?