Adding Event Listeners on Elements - Javascript

前端 未结 5 1239
误落风尘
误落风尘 2020-12-03 17:22

Are there ways for me to listen for onblur or onclick events in javascript from an onload function? instead of doing it in the element itself.



        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-03 17:43

    to further my conversation in the comments section...

    @simplified, try putting this in the < head > of your page

    
    

    and see what happens. also, please advise us on which browser you are using. https://developer.mozilla.org/en/DOM/element.addEventListener

提交回复
热议问题