How can I determine if a dynamically-created DOM element has been added to the DOM?

后端 未结 11 988
滥情空心
滥情空心 2020-12-02 20:07

According to spec, only the BODY and FRAMESET elements provide an \"onload\" event to attach to, but I would like to know when a dynamically-create

11条回答
  •  隐瞒了意图╮
    2020-12-02 20:39

    Can you no do a document.getElementById('newElementId'); and see if that returns true. If not, like you say, wait 100ms and try again?

提交回复
热议问题