jQuery: What's the difference between after() and insertAfter()

后端 未结 11 668
孤街浪徒
孤街浪徒 2021-01-31 07:42

jQuery has an .after() method, and also an .insertAfter() method.

What\'s the difference between them? I think I can use .after()

11条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 08:08

    One important things apart some syntax is that memory leak and performance. insertafter is more efficient than insert when you have tons of dom elements. So prefer insertafter instead of after.

提交回复
热议问题