What attribute (or...) to use when trying to grab a single item's id from a list in jQuery?
<p><strong>Revised:</strong> I have a list items on the page that I'm creating from database records (messages).  Each record contains an Id value that I'm currently putting into each individual message.  What I'd like to do is when they click on a view link to grab the message's Id value so that I can then manipulate it with javascript.</p>

<p>Generated html looks like:</p>

<pre><code>&lt;div id"messages"&gt;
  &lt;div class="message"&gt;
    A cool message &lt;a href="/Message/View/1" id="message_1" class="viewMessage"&gt;View&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="message"&gt;
    A cool message &lt;a href="/Message/View/2" id="message_2" class="viewMessage"&gt;View&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="message"&gt;
    A cool message &lt;a href="/Message/View/3" id="message_3" class="viewMessage"&gt;View&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="message"&gt;
    A cool message &lt;a href="/Message/View/4" id="message_4" class="viewMessage"&gt;View&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>When I click on id=message_1 I want to get the id value of 1.  I'm trying to avoid string manipulation in order to get the id value: like get the value after a '_'.  It would be great if I could use a single attribute with the value '1' in it.</p>

<pre><code>$('.viewMessage').click(function() {
  ...$(this).messageId...
});
</code></pre>

<p>Can I just make an attribute up?  I'll actually try this too, but am thinking about the whole xhtml strict stuff so was thinking there's something better than doing that.</p>
