Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/10/2007, 16:00
frijolerou
 
Fecha de Ingreso: diciembre-2003
Mensajes: 1.583
Antigüedad: 20 años, 4 meses
Puntos: 13
Re: Obtener Id de Fila y Columna

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>GATO</title>
<script language="javascript">
function calcular(elemento)
{
	alert("ID columna (td):" + elemento.id);
	alert("ID fila (tr):" + elemento.parentNode.id);
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<div align="center" style="width:100%">
<br /><br />
<table border="2" cellpadding="1" cellspacing="1" id="mitabla">
<tr id="1a">
<td width="102" id="1" style="height:100px;width:100px" onmouseover="calcular(this)"></td>
<td width="98" id="2" style="height:100px;width:100px"></td>
<td width="100" id="3" style="height:100px;width:100px"></td>
</tr>
<tr id="2a">
<td id="1" style="height:100px;width:100px"></td><td id="2" style="height:100px;width:100px"></td><td id="3" style="height:100px;width:100px"></td>
</tr>
<tr id="3a">
<td id="1" style="height:100px;width:100px"></td><td id="2" style="height:100px;width:100px"></td><td id="3" style="height:100px;width:100px"></td>
</tr>
</table>
</div>
</form>
</body>
</html> 
Ojo! el atributo ID aplicado a un elemento es único e irrepetible dentro del documento.
__________________
El conocimiento es libre: Movimiento por la Devolución