title: Javascript best practice - onclick vs unobstrusive
body: <p>In our project currently I have the following problem. I have to bind some clicks to a list of elements locking like the following:</p>
  <pre>
    &lt;ul&gt;
      &lt;li class="listeelement" id="load-content-id-1"&gt;&lt;div&gt;listcontent&lt;/div&gt;&lt;/li&gt;
      &lt;li class="listeelement" id="load-content-id-2"&gt;&lt;div&gt;listcontent&lt;/div&gt;&lt;/li&gt;
      &lt;li class="listeelement" id="load-content-id-3"&gt;&lt;div&gt;listcontent&lt;/div&gt;&lt;/li&gt;
      &lt;li class="listeelement" id="load-content-id-4"&gt;&lt;div&gt;listcontent&lt;/div&gt;&lt;/li&gt;
    &lt;/ul&gt;
  </pre>
  <p>The click on <code>.listelement</code> should send a request to a specific action with specific params like element-id and something like that (-&gt; module/action?id=1&amp;something=something).</p>
  <p>I want to write a generic request class that send the request and handle all things, that have to do with the click and the request and I'm not sure if it is a good way to bind the click unobtrusive to the class <code>.listelement</code> and to save the action and param information somewhere in my markup OR if it is much better to bind the click by the <code>onclick=&quot;sendRequest(action, params)&quot;</code>.</p>
  <p>The obstrusive-onclick-solution seems to me much easier, but I'm not sure if it is also a GOOD solution.</p>
  <p>Would be happy if someone could give an opinion to that.</p>