title: How to catch the button elementId as a parameter into a function
body: <p>I want to add three buttons on a web form. Each button has its own id. When I click a button, I want the content of a div to become visible and others to be hidden. However, now I use three functions that add as an event to each button. Is there a smart way to create one function and add the elementId as a parameter? I want to "trap" the requesting object.</p>
  
  <pre><code>function myCoolFunction(parameter) {
  if(parameter=="button1") {
    hilight("button1");
  }
  if(parameter=="button2") {
   // do something else for example
  }
  
  }
  </code></pre>
  
  <p>Thanks,</p>