Get id element of an <a> tag
<p>I'm parsing XML and putting it in a simple table like this:</p>

<pre><code>function showData(message) {
    var str = "&lt;table border=1 class='editable'&gt;";
    for (var i = 0; i &lt; message.length; i++) {
        str += "&lt;tr&gt;" + "&lt;td&gt;" + message[i].id + "&lt;/td&gt;" +
                       "&lt;td&gt;" + message[i].name + "&lt;/td&gt;" +
                       "&lt;td&gt;" + message[i].url + "&lt;/td&gt;" +
                       "&lt;td&gt;" + message[i].desc + "&lt;/td&gt;" + 
                       "&lt;td&gt;" + "&lt;a href='javascript:deleteRequest();' id=message[i].id&gt;delete&lt;/a&gt;" + "&lt;/td&gt;" + "&lt;/tr&gt;";
    }
    str += "&lt;/table&gt;";
    return str;
}
</code></pre>

<p>I have an  tag in the last column of my table and I'm trying to set the id of the  tag, or be able to get it from my deleteRequest method so I can delete that entry in the table.  </p>

<p>1) I'm not sure if I'm setting the id correctly for the  tag.</p>

<p>2) I'm not sure how to get the id in my deleteRequest method for the selected  tag, like a sender in iOS, or maybe to pass the id in as an argument to deleteRequest().  I'm not sure which method is better.  I tried to do a simple alert(arguments[0]) to see what gets passed in this case, and I get undefined.  So I'm kind of lost what to do as I'm just learning Javascript.  Thanks.</p>
