 <p>You forgot the quotes around the title.</p> <pre><code> $.each(json, function(i, item) { template += '&lt;p&gt;&lt;a href="javascript:void(0)" onClick="formatDescrip(' + i + ',\"' + json[i].title + '\")"&gt;' + this.title + '&lt;/a&gt;&lt;/p&gt;'; }); </code></pre> <p>Instead of setting up the handlers that way, however, why not use jQuery's ".delegate()"?</p> <pre><code> $.each(json, function(i, item) { template += '&lt;p&gt;&lt;a class="dynamic" data-index="' + i + '" href="#"&gt;' + this.title + '&lt;/a&gt;&lt;/p&gt;'; }); containerList.delegate("a.dynamic", "click", function(ev) { formatDescrip($(this).data('index'), $(this).text()); }); </code></pre> <p>Or something like that; if the list is extended multiple times then the ".delegate()" call should probably be done once, outside the handler.</p> <p><em>edit</em> &mdash; if the "formatDescrip()" function needs access to the original "event" object (whatever those things are that you use to make the list of <code>&lt;a&gt;</code> tags), you can pass it in to "formatDescrip()" instead of the index, and then modify the other function as necessary:</p> <pre><code> containerList.delegate("a.dynamic", "click", function(ev) { formatDescrip( json[$(this).data('index')] ); }); // ... function formatDescrip(eventObj) { alert(eventObj.title); // // ... more code here ... // } </code></pre>