javascript - Jquery changing ID of cloned element children not working -


i trying clone element , change id of 1 of children:

var s = $('.runwell').clone().wrap('<div>').parent().html(); s.find('#tag' + runnum).attr('id', 'tag'+ (++runnum)); 

but not working, doing wrong ?? how change id of child of cloned element ?

you don't have go html..just use cloned jquery object.

try this

var s = $('.runwell').clone().wrap('<div>'); s.find('#tag' + runnum).attr('id', 'tag'+ (++runnum)); 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -