Advertisement
GochiSiyan

javascript loading

Feb 11th, 2021
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. (function(){
  2. Array.from(document.querySelectorAll('a.button')).forEach(function(value,index){
  3. value.addEventListener('click',function(e){
  4. elem = this
  5. elem.classList.add('the-loading')
  6. setTimeout(function(){
  7. elem.classList.remove('the-loading')
  8. },2000)
  9. })
  10. })
  11. Array.from(document.querySelectorAll('input[type="submit"]')).forEach(function(value,index){
  12. value.addEventListener('click',function(e){
  13. elem = this
  14. defaultt = elem.value
  15. elem.value += '...'
  16. setTimeout(function(){
  17. elem.value = defaultt
  18. },2000)
  19. })
  20. })
  21. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement