Changing HTML & CSS
Content
innerHTML— HTML markuptextContent— plain text (safer)
CSS
element.style.color— inline styleclassList.add/remove/toggle— preferred
innerHTML — HTML markuptextContent — plain text (safer)element.style.color — inline styleclassList.add/remove/toggle — preferredconst box=document.querySelector('.box');
box.textContent='New text';
box.style.backgroundColor='#6366f1';
box.classList.add('active');
box.classList.toggle('dark');
More in JavaScript