title: Javascript: Set eventListener to DOM object without window.onload?
body: <p>My <code>index.html</code> include two javascript codes which are <code>plugin.js</code> and <code>main.js</code>(main include after plugin),<br>
  I want to make <code>plugin.js</code> as a reusable plugin, like checking if the <code>index.html</code> file has any elements which have <code>click-me</code> class attribute, if <code>index.html</code> has this kind of elements, then set every this kind of elements an eventListener.  </p>
  
  <p>I want my <code>window.onload</code> function ALWAYS in <code>main.js</code> rather than <code>plugin.js</code>, but in this case I cant' get DOM object by className in <code>plugin.js</code>, I also don't want to call any function of <code>plugin.js</code> in <code>main.js</code>.</p>
  
  <p>Does anyone ahs any idea?</p>