<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="user">11</div>
<div id="name">11</div>
<script>
var el = document.querySelector('#user');
var el2 = document.querySelector('#name');
var observer = new MutationObserver(function(mutations) {
document.querySelector('#name').className = el.className;
});
observer.observe(el, { attributes: true});
setInterval(function(){
el.classList.toggle('class');
}, 3000);
</script>
</body>
</html>
пример крайнего варианта