Will this cause a browser memory leak?

I create a couple divs with an `onclick` event on them as children of 'parentDiv'. In the future, I set `parentDiv.innerHTML = 'xyz'` where xyz is more divs with `onclick` events, which replace the old ones. My question: will any browsers leak memory because I did not remove the `onclick` events of the the old div's before removing them from the dom?

以上就是Will this cause a browser memory leak?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准