《前端》--jQuery  - replaceWith() 方法

 https://www.w3school.com.cn/jquery/manipulation_replacewith.asp

replaceWith() 方法用指定的 HTML 內容或元素替換被選元素。replaceWith() 與 replaceAll() 作用相同。差異在於語法:內容和選擇器的位置,以及 replaceAll() 無法使用函數進行替換。

語法:

$(selector).replaceWith(content)
$(selector).replaceWith(function())

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章