how to clone content of a div to another div

前端 未结 4 2081
时光说笑
时光说笑 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 04:05

    I don't agree. Clone can save data without applying to the content.

    Look here:

    http://www.jsfiddle.net/dactivo/FqffM/

    var mylayer=$('.hello').clone();
    

    Here you can manage the variable "mylayer" as you want, and it's not in the DOM.

提交回复
热议问题