Class is meant for CSS
The problem with above code is that class names in the html markup was meant for web design. By using css class for functional work, I have made both the design team and the front end development team perpetually terrified of change.
If designer wants to change markup from
There has to be a better way which clearly separates the design elements from functional elements.
data-behavior to rescue
data-behavior usage can be best understood by an example.
The html markup will change from
More usage of data-behavior