Busy Button Was a quick and simple feature using a single function and the button id to add in a progress system or some feedback that something is happening Disables the button and inserts a countdown percentage hacky thing the percentage gets slower as it gets nearer to 100 so it never really reaches 100 You can add in a work around to pass the progress as an extra Some fancy extra features if you want to extend the concept Add colors changes color as it progresses Other styles a blue bar underlining the text and moving along Real progress extra option or additional function that would set override count variable Have fun with the busy button button id testid onclick toggleButtonAnimation testid Start div button onclick toggleButtonAnimation testid Toggle div script function toggleButtonAnimation bid let el document getElementById bid if el timer clearInterval el timer el timer null el innerHTML el text el disabled false return el disabled true el text el innerHTML el count 0 el timer setInterval el innerHTML el text el count toFixed 0 el count el count 1 el count 100 100 600 script
e fun with the busy button button id testid onclick toggleButtonAnimation testid Start div button onclick toggleButtonAnimation testid Toggle div script function toggleButtonAnimation bid let el document getElementById bid if el timer clearInterval el timer el timer null el innerHTML el text el disabled false return el disabled true el text el innerHTML el count 0 el timer setInterval el innerHTML el text el count toFixed 0 el count el count 1 el count 100 100 600 script