javascript addeventlistener type ??





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.if(button.addEventListener). Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions, and Opera 6.0 and earlier versions.The type of the event object depends on the specified event. My previous code works: