If you google "finite state machine javascript", you'll see that lots of people have given it some thought, but it never seems to catch on. My theory is that state machines aren't a natural way to think about most problems nor are they a natural solution to most UI/frontend dev problems. Button states are a natural fit for state machines because they have a finite, well defined and well understood number of states. But, because of that, we already have the equivalent state machine built directly into CSS3 in the form of selectors (:hover, :disabled, :focused, etc).