title: Using onclick() inside another function
body: <pre><code>function layoutMod() {
      standardId = document.getElementById("standard");
      fancyId = document.getElementById("fancy");
      standardId.onclick = function() {
          standard();
      };
  
      fancyId.onclick = function() {
          fancy();
      };
  };
  </code></pre>
  
  <p>How can I use the onclick events defined above in a function??? Is it a good practice to load the function at page load?? I need to define in a function the onclick event beacuse I don't want to use global variables.</p>