# How to do DOM cleanup?

**URL:** <https://discuss.emberjs.com/t/how-to-do-dom-cleanup/3871>\
**Category:** Proposals\
**Created:** [January 16, 2014, 6:58pm UTC](https://discuss.emberjs.com/t/how-to-do-dom-cleanup/3871 "2014-01-16T18:58:58Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![radq](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/radq/32/4898_2.png) [@radq](https://discuss.emberjs.com/u/radq)\
**Post date:** [January 16, 2014, 9:39pm UTC](https://discuss.emberjs.com/t/how-to-do-dom-cleanup/3871/5 "2014-01-16T21:39:55Z")

</div>

`willClearRender` is called when a view is about to be rerendered and also before `willDestroyElement` is triggered.

[http://madhatted.com/2013/6/8/lifecycle-hooks-in-ember-js-views](http://madhatted.com/2013/6/8/lifecycle-hooks-in-ember-js-views)

> [@Attaching jquery events to bound items](http://discuss.emberjs.com/t/attaching-jquery-events-to-bound-items/3580/12):
>
> On a related note, does anyone see any problems with this approach? [Lifecycle Hooks in Ember.js Views :: madhatted.com](http://madhatted.com/2013/6/8/lifecycle-hooks-in-ember-js-views) Notice the use of ‘willClearRender’ to clean up custom event handlers… agree this is a good practice? I’m looking for best practices to create event handlers and then clean up.

---

_[View the full topic](https://discuss.emberjs.com/t/how-to-do-dom-cleanup/3871)._
