xxxxxxxxxx
document.getElementById("myText").className = "anyNewClass"
xxxxxxxxxx
<html>
<body>
<p id="p2">Hello World!</p>
<script>
document.getElementById("p2").style.color = "blue";
</script>
</body>
</html>
xxxxxxxxxx
const thing = document.getElementById("thing");
thing.style.backgroundColor = "blue";