Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/04/2008, 11:43
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 3 meses
Puntos: 772
Re: Problema con JavaScript

Hola de nuevo.

A ver si te sirve:

Código:
<td id="im" class="estilotd3">
<form name="partido1">
<input type="button" name="bt1" value="1" onclick="tapa1(this,0)">
<input type="button" name="btx" value="X" onclick="tapa1(this,1)">
<input type="button" name="bt2" value="2" onclick="tapa1(this,2)">
</form>
Código:
<script type="text/javascript">
var imagenes = ['imagen1.jpg','imagen2.jpg','imagen3.jpg']
function tapa1(obj,num) {
  obj.value = 0; 
  document.getElementById('im').style.background = 'url(' + imagenes[num] + ')';
}
</script>
Saludos,

Luego te doy mi dirección postal, para que me mandes el poni. Mi sobrinito se va a poner muy contento