javascript - On load function checking for button controle -


i inherited vscript code create web service redirect button based on logged in user; if user not found button not created , error text displayed, asked set onload javascript function automatically click button-that did.i need check if button exists first before click it.what best way check if button exist onload in javascript?

thnaks

this should work fine:

var button = document.getelementbyid("the button's id");  window.onload = function() {     if (button != null) {         // code     } } 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -