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

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -