I have a javascript table that displays contents from an XML file(that stores letter details), I have at each row a view button which I would like the user to be able to click and it will display the letter details for them. Is this possible?
The javascript I have is:
function showLetter() {
for (var i=0; i<letters.length; i++) {
id=letters[i].getAttribute("id");
title=letters[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
sender=letters[i].getElementsByTagName("author")[0].childNodes[0].nodeValue;
recipient=letters[i].getElementsByTagName("recipient")[0].childNodes[0].nodeValue'
date=memos[i].getElementsByTagName("date")[0].childNodes[0].nodeValue;
body=memos[i].getElementsByTagName("body")[0].childNodes[0].nodeValue;
document.write("<tr><td class='noBox'>"+id+"</td>"+
"<td>"+title+"</td>"+
"<td class='center'>"+sender+"</td>"+
"<td class='center'>"+recipient+"</td>"+
"<td class='center'>"+date+"</td>"+
"<td class='center'><input type='submit' name='submit' value='remove' onClick='showItem()'></td></tr>");
}