Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/03/2008, 13:15
dabas
 
Fecha de Ingreso: julio-2006
Mensajes: 22
Antigüedad: 17 años, 9 meses
Puntos: 0
al cambiar id y className internet explorer no pone los estilos

¿porque no me funciona esto en IE?, en FF esta perfecto
parece que no actualiza los estilos y no se porque es

gracias por vuestra ayuda

Código HTML:
<html>
<head>
	<script type="text/javascript">
	function addnewRow(){
		var table = document.getElementById('mytable');

		//insertar una linea en la tabla, en la ultima posicion
		var newRow = table.insertRow(-1);
		
		//añadimos los eventos IE != FF
		if(typeof newRow.addEventListener != 'undefined'){
			newRow.addEventListener('click', clickRow, false);
			newRow.addEventListener('mouseover', mouseoverRow, false);
			newRow.addEventListener('mouseout', mouseoutRow, false);
		}else if(newRow.attachEvent != 'undefined'){
			newRow.attachEvent("onclick", clickRow);
			newRow.attachEvent("onmouseover", mouseoverRow);
			newRow.attachEvent("onmouseout", mouseoutRow);
		}
		
		newRow.insertCell(-1).innerHTML = document.getElementById('nombre').value;
	}
	function clickRow(){
		this.className = 'seleccionado';
	}
	function mouseoverRow(){
		this.id='mouseover';
	}
	function mouseoutRow(){
		this.id='';
	}
	</script>
	<style>
		.seleccionado{ background: #cca; }
		#mouseover { background: #ccc; }
	</style>
</head>
<body>
	<input type="text" id="nombre"/>
	<button onclick="javascript:addnewRow()">&nbsp;+&nbsp;</button>
	<table id="mytable" border="1" width="300px">
		<tr><th>Nombre</th></tr>
	</table>
</body>
</html>