Independant button
<p>I have a Javascript code that creates buttons OnLoad with the attributes being the values from an ASP page that fetches from the database. But whatever event I want each button to do, all the other buttons do it and it executes before the buttons are displayed. Please help...</p>

<pre><code>function createButtons(tbID, tbClass, tbType, tbValue, onClick) {
return '\n&lt;input'
                + (tbID ? ' id=\'' + tbID + '\'' : '')
                + (tbClass ? ' class=\'' + tbClass + '\'' : '')
                + (tbType ? ' type=\'' + tbType + '\'' : '')
                + (tbValue ? ' value=\'' + tbValue + '\'' : '')
                + (onClick ? ' onclick=\''+ onClick + '\'':'')
                + '&gt;';

}


function DisplayButtons(cableData) {

var newContent = '';

$.each(cableData, function (i, item) {

newContent += createButtons(item.CommonCable, null, "submit",       item.CommonCable,alert("clicked"));

});

$('#Categories').html(newContent);
</code></pre>

<p>}</p>
