jQuery .wrap() isn't working

前端 未结 3 1539
心在旅途
心在旅途 2021-02-07 13:30

I\'m probably doing something wrong but I\'ve tried all sorts of things and can\'t seem to get a collection of jQuery objects wrapped. The following just outputs the link HTML,

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-07 14:07

    You need a string to pass into .html(), I think you're after this instead:

     $dropdownSections[i].empty().append($primary.parent());
    

    This gets the .parent() (since you just wrapped it in one) and sets the contents to that.

提交回复
热议问题