Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/11/2010, 05:38
robinsv
 
Fecha de Ingreso: mayo-2009
Mensajes: 15
Antigüedad: 15 años
Puntos: 0
Problema If de boton 1 vez pulsado tenga 1 color y al volverlo a pulsar el 1er color

Código:
	function Funcion2(COLOR) {
	var aux ;
	
		if (document.getElementById(COLOR).style.background == "#ffffff"){
				document.getElementById(COLOR).style.background="#000000";		
		}
		else {
				document.getElementById(COLOR).style.background = "#ffffff";
		}	
	}
Lo que quiero esque el boton si tiene el fondo blanco lo pase a negro y si esta en negro lo pase a blanco, pero siempre se desvia por el Else y lo pone de color blanco.

Saludos!