Hola
Prueba con esto
Código Javascript
:
Ver original<html>
<head>
<script type="text/javascript">
window.onload = function() {
cant_td = document.body.getElementsByTagName('td');
cant_inpt = document.body.getElementsByTagName('input');
for(i=0; i < cant_td.length; i++) {
for (j=1; j < cant_inpt.length; j+=2) {
cant_inpt[j].onclick = function() {
document.getElementById('td_'+this.id).style.backgroundColor = 'red';
}
}
}
}
</script>
</script>
</head>
<body>
<table border="1">
<tr>
<td id="td_1"><input type="text" value="" /> <input type="checkbox" id="1" /></td>
</tr>
<tr>
<td id="td_2"><input type="text" value="" /> <input type="checkbox" id="2" /></td>
</tr>
<tr>
<td id="td_3"><input type="text" value="" /> <input type="checkbox" id="3" /></td>
</tr>
</table>
</body>
</html>
Suerte