how to clone content of a div to another div

前端 未结 4 1960
时光说笑
时光说笑 2021-02-01 03:08

I want to copy the content of a selected div to another div with jquery clone. but I dont want to append it anywhere

what I mean is when we make a clone of a div with j

4条回答
  •  生来不讨喜
    2021-02-01 03:54

    var a = $('#selector').html();
    var b = $('#selector').html(a);
    

    not sure I understood you properly but I think thats what you meant :)

提交回复
热议问题