Alternative to passing data in onClick?
<p>I have a web page which lists all database records from a certain server.
Along side each row are a few buttons which allow you to rename or delete records.</p>

<pre><code>INPUT( _value='Rename', _type="button", _class='appbutton', _onclick='renameApplication({0},"{1}")'.format(app.id,app.name))
</code></pre>

<p>Which generates something like:</p>

<pre><code>&lt;input class="appbutton" type="button" value="Rename" onclick="renameApplication(3,"My Application")"&gt;&lt;/input&gt;
</code></pre>

<p>(The backend templating engine is web2py, but that's not really important.)</p>

<p>I am generating these buttons dynamically. Currently I pass the data each button needs through onClick.</p>

<p>According to <a href="http://stackoverflow.com/questions/12627443/jquery-click-vs-onclick">jQuery.click() vs onClick</a> I shouldn't be doing this anymore. But if that is the case, how should I be passing data so that each button click can use dynamic data written server side (the application ID and name in this instance.)</p>

<p>I can't do dom traversal through the record to grab the data because the row structure might change.</p>

<p>I can't use custom attributes because I need to support less than HTML 5, and I'm not going to modify the doctype! (<a href="http://stackoverflow.com/questions/1735230/can-i-add-custom-attribute-to-html-tag">Can I add custom attribute to html tag?</a>)</p>

<p>The only thing I can think of is to put data in the id attribute then parse it, but that seems very hackish.</p>

<p>Is there a better way?</p>
