开发者

Dependent method registration | Element i.d. availability

开发者 https://www.devze.com 2023-02-17 12:28 出处:网络
How can one register event handlers to eleme开发者_JS百科nts that are currently loaded into the DOM?Just test them for existence first:

How can one register event handlers to eleme开发者_JS百科nts that are currently loaded into the DOM?


Just test them for existence first:

var signup, signin, bookmark;
if(signup = document.getElementById('signup'))
    signup.onclick = interface_signup;
...

etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消