How to create an empty, non-null jQuery object ready for appending?

后端 未结 6 1927
傲寒
傲寒 2021-02-06 21:04

I want to append some html to an empty non null jQuery object only in the loop but it\'s not working unless I create an object and add an html tag during creation. How can I cre

6条回答
  •  独厮守ぢ
    2021-02-06 21:19

    Your object $new is an empty selector, so append has no sets to append to.

    add is required to add a DOM node, and then you append to those DOM nodes. Don't think you can avoid starting with an .add.

提交回复
热议问题