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
Post a Comment