# How change mutationObserver on created controller?

**URL:** <https://discuss.hotwired.dev/t/how-change-mutationobserver-on-created-controller/1009>\
**Category:** General\
**Created:** [January 20, 2020, 12:26pm UTC](https://discuss.hotwired.dev/t/how-change-mutationobserver-on-created-controller/1009 "2020-01-20T12:26:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drus566](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/drus566/32/682_2.png) [@Drus566](https://discuss.hotwired.dev/u/Drus566)\
**Post date:** [January 20, 2020, 12:26pm UTC](https://discuss.hotwired.dev/t/how-change-mutationobserver-on-created-controller/1009/1 "2020-01-20T12:26:14Z")

</div>

How change mutationObserver on created controller? If i create div element with data-controller attribute and want dynamically change tracking from  
`this.mutationObserver.observe(this.element, { attributes: true, childList: true, subtree: true })`  
on a  
`this.mutationObserver.observe(this.element, { attributes: true, childList: true, subtree: false })`
