Hi,
Replace this line:
alert(document.getElementById('myDataTable').rows[1].cells[1].childNodes[0].data);
with this:
alert($(this).find('td:eq(1)').html());
Some explanation: this
refers to your entire row, where the user double clicks. Then using
td:eq(1)
I find the 2nd cell in your row [remember the index start w/ 0 w/in a row for the cells. The finally
.html()
gets the name w/in the cell!
Hope this helps!