replace classList.add by setAttribute
updated