We’ve got used to writing JavaScript for common UI element functionality like accordions, tooltips, text truncation, etc. But as HTML and CSS got new features and older browsers were no longer supported, we’ve been able to use less and less JavaScript for creating UI elements and focusing it more on logic part of the code.