mutation observer

HTML

<div id=aDiv></div>
Resize this DIV with your mouse. or button<br>
<button onclick="resize()">resize</button>

CSS

body{
  font-family:arial;
  overflow:hidden;
}

#aDiv {background: gray ; 
      resize: both ; 
      overflow: auto ; 
      width: 200px ; 
      height: 200px;
      font-weight: bold;
      color:orange;
      display: flex;

  align-items: center;
  justify-content: center;}

JavaScript

$(function(){    
  mutObs = new MutationObserver(function(){
    elem = document.getElementById('aDiv') ;
  }) ;

  elem = document.getElementById('aDiv') ;
  mutObs.observe(elem,{attributes:true}) ;
}) ;