button transition toggle back and forth using CSS or JS
问题 I would like to create a button that toggles back and forth between two states on click. Currently the first click transitions the button successfully to the second state, but I cannot get the button to transition back to the original state on the second click. Here is my code: $('.popup_contact').on('click', function() { $(this).toggleClass('active'); }); .popup_contact { display: inline-block; min-height: 50px; height: auto !important; width: 100px; padding-top: 5px; text-align: center;