set val of input box on click in table cell
I have a table with one click-able cell (ancor tag). Here is the code for the cell: (php)
echo("<td class=\"tdclick\"><a href=\"javascript:;\" onClick=\" = \"settrnum($fnum));\">$fnum</a>");
Here is what I tried:
$(function settrnum(fnnum){
$('tdclick').onclick = {
$("#flightno").innerHTML = this.val;
};
});
#flightno is the id of the input field I need to set the value = to table cell value.
It doesn't work. Any help is appreciated.