Thnaks... I have tryed:
jQuery("#"+inputID,addedItem).attr("id",newInputID); content1= jQuery("#"+newInputID,addedItem)[0].outerHTML content1=content1.replace(inputID,newInputID) jQuery("#"+newInputID,addedItem)[0].outerHTML = content1 But any result.... My use case: I have a div with inputs , I need to clone it , change all the id/ names and then insertAfert another div. Seems that there are not way to change the name. Another suggestion? On 4 jun, 22:37, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > oscarespwrote: > > I have a code to clone a input. After that I need to change the id > > and name it... seems that change id works fine but not the name: > > > jQuery("#"+inputID,addedItem).attr("id",newInputID); -> works ok > > jQuery("#"+inputID,addedItem).attr("name",newInputID); -> seems > > doesn't work > > > Any idea? > > http://jquery.bassistance.de/api-browser/#attrStringObject > Note that you can't set the name property of input elements in IE. Use > $(html) or .append(html) or .html(html) to create elements on the fly > including the name property. > > Maybe that helps. > > -- > Jörn Zaefferer > > http://bassistance.de