Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/08/2008, 17:42
anion0x
 
Fecha de Ingreso: junio-2008
Mensajes: 110
Antigüedad: 15 años, 11 meses
Puntos: 0
Respuesta: inconveniente con DOM

Pude realizarlo, funciona perfecto en el firefox, pero no es asi en el IE. Alguien puede ver el codigo y decirme que puede ser que lo estoy haciendo mal?
O como me doy cuenta del error, la verdad es que estoy un poco perdido.

Código:
function agregarItem(tbody) {
	
	var tabla = document.getElementById(tbody);
	
	var tr = document.createElement("tr");
	var td = document.createElement("td");
	var h4 = document.createElement("h4");
	var txt = document.createTextNode("Item");
	
	td.setAttribute('colspan','2');
	
	h4.appendChild(txt);
	td.appendChild(h4);
	tr.appendChild(td);
	
	tabla.appendChild(tr);
	
	var tr2 = document.createElement("tr");
	var th2 = document.createElement("th");
	var td2 = document.createElement("td");
	var label = document.createElement("label");
	var txt2 = document.createTextNode("Titulo Lista");
	var input_titulo = document.createElement("input");
	
	input_titulo.setAttribute('type','text');
	input_titulo.setAttribute('name','nombreTitulo');
	input_titulo.setAttribute('class','small');
	

	
	td2.appendChild(input_titulo);
	label.appendChild(txt2);
	th2.appendChild(label);
	
	tr2.appendChild(th2);
	tr2.appendChild(td2);
	
		
	tabla.appendChild(tr2);
	
	
	var tr3 = document.createElement("tr");
	var th3 = document.createElement("th");
	var td3 = document.createElement("td");
	var label3 = document.createElement("label");
	var txt3 = document.createTextNode("Detalle");
	var input_titulo3 = document.createElement("input");
	
	input_titulo3.setAttribute('type','text');
	input_titulo3.setAttribute('name','detalleTitulo');
	input_titulo3.setAttribute('class','small');
	
	
	td3.appendChild(input_titulo3);
	label3.appendChild(txt3);
	th3.appendChild(label3);
	
	tr3.appendChild(th3);
	tr3.appendChild(td3);
	
		
	tabla.appendChild(tr3);


	var tr4 = document.createElement("tr");
	var th4 = document.createElement("th");
	var td4 = document.createElement("td");
	var label4 = document.createElement("label");
	var txt4 = document.createTextNode(" Incluir importe");
	var input_titulo4 = document.createElement("input");
	var check4 = document.createElement("input");
	
	input_titulo4.setAttribute('type','text');
	input_titulo4.setAttribute('name','importeTitulo');
	input_titulo4.setAttribute('class','small');
	
	check4.setAttribute('type','checkbox');
	check4.setAttribute('name','si');
	check4.setAttribute('class','none');
	
	
	td4.appendChild(input_titulo4);
	label4.appendChild(txt4);
	th4.appendChild(check4);
	th4.appendChild(label4);

	
	tr4.appendChild(th4);
	tr4.appendChild(td4);
	
		
	tabla.appendChild(tr4);



}

Última edición por anion0x; 02/08/2008 a las 17:52