HelpeR Не нужно такому учить
<script type="text/javascript">
window.onload = function(){
var table = document.getElementsByTagName('td');
var input = document.getElementsByTagName('input');
for(i=0; i<table.length; i++){
(function(i){
table[i].onclick = function(){
input[i].value = table[i].innerHTML;
};
})(i);
}
};
</script>
<style type="text/css">
td {border-collapse:collapse; border: 1px solid #DDD; padding: 0px 5px; width: 136px;}
input {width: 148px;}
</style>
<table border="0">
<tr>
<td>td1</td>
<td>td2</td>
<td>td3</td>
</tr>
</table>
<input type="text" value="" />
<input type="text" value="" />
<input type="text" value="" />