js代码
<script> const button = document.querySelector('.button'); const submit = document.querySelector('.submit'); function toggleClass() { this.classList.toggle('active'); } function addClass() { this.classList.add('finished'); } button.addEventListener('click', toggleClass); button.addEventListener('transitionend', toggleClass); button.addEventListener('transitionend', addClass);</script> </body>