No-Library (pure JS), HTML, CSS, JavaScript
Basic demo
No-Library (pure JS), HTML, SCSS, JavaScript
jQuery 2.2.3, HTML, CSS, JavaScript
Both items have flex-basis: 200px defined. In 'equilibrium situation' they'll get those widths exactly. If there's less space, the second one shrinks 3x faster than the first. If there's more space, the first one grows 5x faster than the second.
Toggle class name on click in jQuery
jQuery 3.4.1, HTML, CSS, JavaScript
jQuery 1.4.2, HTML, CSS, JavaScript
jQuery 3.3.1, HTML, CSS, JavaScript