But what if there's already a #span2 in the document?

Perhaps it would be better to give it the ID span1_1 (or similar).

On Fri, Sep 25, 2009 at 6:31 PM, jan1979 <jan.zitn...@gmail.com> wrote:
>
>
> 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.
>
>

Reply via email to