title: Eventhandler with classes
body: <p>i've some div's with the same class. When I click one of those div's, I want change the display from other div's to 'block'. I'm currently using inline javascript, but I want to do it without inline javascript. What I have now:</p>
  
  <pre><code>&lt;div class="test_a" id="example_a" onclick="testfunction(this)"&gt;&lt;/div&gt;
  &lt;div class="test_a" id="example_b" onclick="testfunction(this)"&gt;&lt;/div&gt;
  &lt;div class="test_a" id="example_c" onclick="testfunction(this)"&gt;&lt;/div&gt;
  &lt;div class="test_a" id="example_d" onclick="testfunction(this)"&gt;&lt;/div&gt;
  &lt;div class="test_a" id="example_e" onclick="testfunction(this)"&gt;&lt;/div&gt;
  
  &lt;div class="test_b" id="example_a_test"&gt;&lt;/div&gt;
  &lt;div class="test_b" id="example_b_test"&gt;&lt;/div&gt;
  &lt;div class="test_b" id="example_c_test"&gt;&lt;/div&gt;
  &lt;div class="test_b" id="example_d_test"&gt;&lt;/div&gt;
  &lt;div class="test_b" id="example_e_test"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>my function in javascript:</p>
  
  <pre><code>function testfunction(x){
  var example = document.getElementById(x.id + "_test");
  example.style.display = 'block';
  }
  </code></pre>
  
  <p>So when you click on the div with id example_a, I want to change the display from example_a_test.</p>
  
  <p>working example: <a href="http://pastehtml.com/view/c63rmz6tw.html" rel="nofollow">http://pastehtml.com/view/c63rmz6tw.html</a></p>
  
  <p>Now, how to do this with eventhandlers?</p>