How to create function for disable all element with button tag after 1 second in javascript? -


maybe it'll looks this:

var buttons = document.getelementsbytagname("button"); function disbtn(){         settimeout(function(){             (var = 0; < buttons.length; i++) {                     buttons[i].style.display = 'none';                 }         }            , 1000);     } 

could please give me simple solution when call disbtn() function button tag in current page disabled after 1 second delay?

you can try:

var buttons = document.getelementsbytagname("button"); function disbtn(){         settimeout(function(){             (var = 0; < buttons.length; i++) {                     buttons[i].setattribute('disabled',true);                 }         }            , 1000);     }  disbtn(); 

demo


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -