Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/03/2007, 10:54
Avatar de keldrox
keldrox
 
Fecha de Ingreso: noviembre-2005
Mensajes: 95
Antigüedad: 18 años, 6 meses
Puntos: 2
setAttribute( "style" ) IE no funciona.

He estado buscando información sobre esto, pero no encuentro nada que ayude ha solucionarlo, tal vez no le haya hecho la pregunta perfecta a google, a ver si me podeis hechar un cable.

Un saludo y muchas gracias .

Código:
<html>

	<body>
	
	<div id="contenedor">
	
		<script language="javascript">
			
			function mostrar()
			{
				this.verInsertText = ( document.getElementsByTagName("body")[0].innerText != undefined ) ? true : false;
			
				var fondoMainMenu = document.createElement( "div" );
					fondoMainMenu.setAttribute( "id", "estiloFondo" );
					// Esto es lo que no funciona en IE.
					fondoMainMenu.setAttribute( "style", "background-color: #ff0000;" );
					
				if( !this.verInsertText )
				{
					fondoMainMenu.textContent = "Hola, quiero salir...";
				}
				else
				{
					fondoMainMenu.innerText = "Hola, quiero salir...";
				}
				
				document.getElementById("contenedor").appendChild(fondoMainMenu);
			}
			
			mostrar();
		
		</script>
		
		</div>
		
	</body>
	
</html>