jQuery .wrap() not wrapping around a cloned element

前端 未结 2 1047
说谎
说谎 2021-02-08 01:37



        
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-08 02:26

    The key is this line in the .wrap() documentation:

    This method returns the original set of elements for chaining purposes.

    .wrap() only operates on an element already in the DOM. So, you will need to insert it, then wrap it.

提交回复
热议问题