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

后端 未结 6 1923
傲寒
傲寒 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:27

    i testet the above solution but it did not work for me, it always stayed as empty jQuery object...

    if anybody interested, here is my solution:

    var jQueryElements = [],
        $new;
    
    $.each( [1, 2, 3, 4], function(i, v){
      jQueryElements = jQueryElements.push($('
    ').get(0)); }); $new = $(jQueryElements);

提交回复
热议问题