i want to use first column of html table to hold key values which when a cell is clicked, a certain event is triggered say fetch data from database using the selected key.the following code can select any code but i want to specify the first column of the table only to hold 'key data' i.e the click event should be effected on first column of my table.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <title>Javascript events</title>

<script type="text/javascript"><!--

function getVal(e) {
    var targ;
    if (!e) var e = window.event;
    if (e.target) targ = e.target;
    else if (e.srcElement) targ = e.srcElement;
    if (targ.nodeType == 3) // defeat Safari bug
        targ = targ.parentNode;


onload = function() {
    var t = document.getElementById("main").getElementsByTagName("tr");
    for ( var i = 0; i < t.length; i++ )
        t[i].onclick = getVal;



<table id="main"><tr>


please improve it to work for the column only e.g column index zero which has ID numbers.