Clone style in jQuery?

后端 未结 9 1712
轻奢々
轻奢々 2021-02-05 03:56

I have a called spn1, which has some style from inline + CSS file.

I have another called spn2

9条回答
  •  半阙折子戏
    2021-02-05 04:26

    Something

    var replica=$('#template').clone();
    replica
    .removeAttr('id')
    .css('display', 'block')
    .find('span').text('Whatever');
    replica.appendTo('#container');
    

提交回复
热议问题