 <p>How about we do this the jQuery way.</p> <h3>HTML</h3> <pre><code>&lt;ul id="items"&gt; &lt;li&gt;&lt;a href="#" class="item" title="Gallery" data-key="1" data-title="A+D Gallery" data-address="123 Main St" data-hours="10:00, 10:30, 11:00, 11:30, 1:00"&gt;Gallery&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="item" title="Radio" data-key="2" data-title="Radio" data-address="321 Center Dr" data-hours="11:00, 11:30, 12:00, 12:30, 1:00, 1:30, 2:00, 2:30"&gt;Radio&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <h3>JavaScript</h3> <pre><code>$(function() { $('#items').on('click', 'a.item', function () { console.log($(this).data('key')); return false; }); }); </code></pre> <h3>Demo <a href="http://jsfiddle.net/mattball/XBrfH/" rel="nofollow">http://jsfiddle.net/mattball/XBrfH/</a></h3>