Tema: contador
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/02/2006, 13:23
Davhira
 
Fecha de Ingreso: mayo-2005
Mensajes: 63
Antigüedad: 19 años
Puntos: 1
Hola

hola, espero te sirva este codigo... le agrege indice de fila y celda

<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
contador=0
function ver_numero(objeto,fila)
{
contador+=1
no_celda=objeto.cellIndex+1
no_fila=fila.rowIndex+1
alert("Esta es la Fila:" + no_fila +" y la celda: "+no_celda + " y has clickeado " +contador)
}
</script>
</head>

<body>
<form name="formulario">
<center>
<table border="2">
<tr>
<td onclick="ver_numero(this,this.parentNode)">Celda1</td>
<td onclick="ver_numero(this,this.parentNode)">Celda2</td>
<td onclick="ver_numero(this,this.parentNode)">Celda3</td>
<td onclick="ver_numero(this,this.parentNode)">Celda4</td>
<td onclick="ver_numero(this,this.parentNode)">Celda5</td>
</tr>
<tr>
<td onclick="ver_numero(this,this.parentNode)">Celda6</td>
<td onclick="ver_numero(this,this.parentNode)">Celda7</td>
<td onclick="ver_numero(this,this.parentNode)">Celda8</td>
<td onclick="ver_numero(this,this.parentNode)">Celda9</td>
<td onclick="ver_numero(this,this.parentNode)">Celda10 </td>
</tr>
<tr>
<td onclick="ver_numero(this,this.parentNode)">Celda11 </td>
<td onclick="ver_numero(this,this.parentNode)">Celda12 </td>
<td onclick="ver_numero(this,this.parentNode)">Celda13 </td>
<td onclick="ver_numero(this,this.parentNode)">Celda14 </td>
<td onclick="ver_numero(this,this.parentNode)">Celda15 </td>
</tr>
</table>
</
center>
</form>
</body>
</html>