Hi there, I was just looking for the same issue...
I can't really understand why or why not using inline event-handler - "no, no, never" confuses me totally...
For most cases I do agree. Binding an event-handler to several equal elements makes sense and ends up in "nice and less"-code.
But, how do you solve this.
Having a data-table with n rows, e.g. representing a user or whatever dataset.
Having 10+ columns which are representing subsets of detail-data.
Each table-cell (c) could represent more subsets of data. e.g a list of phone nrs., email-addresses, or or or. (x entry per cell)
And..each single cell entry (x/c) should be: view- (if more is behind it), edit- and deletable. (simple xhr call) (view-icon, edit-icon, delete-icon per c/x - no, no easy dropdown)
(Don't ask why or what for - that's what the customer wants)
So, I end up with at least either one event-handler, or one per row, or one per...I skip this..that part is not the question or problem.
But I have to "mark" every of the x/c cell entry's with something like "What to do, Who am I" and definitely more (using attributes I think).
Assuming further more that I build the table on the server-side requested by a xhr-request - then I have to have a very "nice" client-side script.. (ok, no problem with jQuery e.g.) ...i could easily send a little js to call the binding function(s?). (or extend the response handler.., or whatever more)
Sounds like there is no real advantage in binding the events to that many different objects, isnt it?
I will end up with the same size of code (instead of "onClick="f(xx,yy,zz)" I'll have at least the same, or more attribute="value1,value2,.." code + parsing, more)
Plus..I'll end up with at least one potential source of error more...the binding function(s) on the client side.
So building the table and attaching to each element instantly a little inline event sounds soooooo easy for me.
Could someone enlighten me please?!