May be you are trying to attach a function when table rows are clicked.
var table = document.getElementById("tableId");
var rows = table.getElementsByTagName("tr");
for (i = 0; i < rows.length; i++) {
rows[i].onclick = functioname(); //call the function like this
}