[jQuery] How to rename cloned element id (increase by one)?

[jQuery] How to rename cloned element id (increase by one)?


Hello.
I have following code:
function addElement(id) {    
$(document).ready(function(){
    if ( $("#span1") ) {
     $(id).clone().prependTo("#span1");
    }
});

}
How can I rename cloned element? Should be fine to increase its name by one,
e.g.: original id1 into cloned id2 and so on.
--
View this message in context: http://www.nabble.com/How-to-rename-cloned-element-id-%28increase-by-one%29--tp25620242s27240p25620242.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.