el.className is the whole class string (overwriting it clobbers other classes). el.classList is the surgical API: add, remove, toggle, contains. Driving appearance by toggling classes (styled in CSS) is the DHTML pattern that aged best — it keeps logic and presentation separate.