There's a reason why we haven't used setAttribute() to set classes. If we use it to change a class, it overrides the previous class.

We can see the issue if we run this code and try to make the text display as both bold and italic.

Make sure to pick setAttribute.