Clone style in jQuery?

后端 未结 9 1583
轻奢々
轻奢々 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

    Try this:

    $("#spn2").attr("style", $("#spn1").attr("style"))
        .addClass($("#spn1").attr("class"));
    

提交回复
热议问题