const mssg = document.querySelector('p');//get the class of the p tag
console.log(mssg.getAttribute('class'));//the class is currently 'error'
mssg.setAttribute('class', 'success');//now the p tag's class is changed to 'success'
console.log(mssg.getAttribute('class'));//the new class of the p tag is 'success'