hi all,
im adding a textbox using the code below, but the textbox just appears and disappears immediately after being displayed. does anyone know what im doing wrong here.
var txt = document.createElement("input");
var mydiv =document.getElementById("div1");
txt.setAttribute ('type', 'text');
txt.setAttribute ('id', "name");
txt.value = "defValue";
txt.name = "name";
txt.style.top=50;
txt.style.left=50;
txt.style.width=10;
txt.style.height=10;
mydiv.appendChild(txt);
Regards
im adding a textbox using the code below, but the textbox just appears and disappears immediately after being displayed. does anyone know what im doing wrong here.
var txt = document.createElement("input");
var mydiv =document.getElementById("div1");
txt.setAttribute ('type', 'text');
txt.setAttribute ('id', "name");
txt.value = "defValue";
txt.name = "name";
txt.style.top=50;
txt.style.left=50;
txt.style.width=10;
txt.style.height=10;
mydiv.appendChild(txt);
Regards