jQuery: Can't select just appended element

前端 未结 7 1594
天涯浪人
天涯浪人 2021-02-18 13:55

This is what happens on event:

$(\'div#pages\').append($(\'
...
\'));

And then, on another eve

7条回答
  •  迷失自我
    2021-02-18 14:27

    Had the same issue, found that if I added the listener before adding the div, it wouldn't find the div. Make sure to add the listener after making the object.

提交回复
热议问题