res = eval(document.getElementbyId("L1"+a).innerText);//why do you have to use innerHTML alert(res);
sorry res = eval(document.getElementById("L1"+a)); alert(res.innerText); alert(res.innerHTML);
TO springwood: It is the same fault as innerHTML, I have got the valuse by cell. I just wonder why is no smooth when use innerHTML. thank you a lot. :)
<script>function getid(a){ var obj=document.all["L1"+a]; alert(obj.innerHTML); } </script>
你这样获取的只是一个字符串而不是一个对象,不过其他人也给出了答案,用eval把
can you please paste all the source code here?
<script> var info1; function getid(a){ info1="L1"+a; alert(info1); alert(window.innerHTML=info1); } </script>这样试一下~~~~
一样提示info1未定义
:(
alert(res);
res = eval(document.getElementById("L1"+a));
alert(res.innerText);
alert(res.innerHTML);
It is the same fault as innerHTML, I have got the valuse by cell. I just wonder why is no smooth when use innerHTML.
thank you a lot. :)
var obj=document.all["L1"+a];
alert(obj.innerHTML);
}
</script>
var info1;
function getid(a){
info1="L1"+a;
alert(info1);
alert(window.innerHTML=info1);
}
</script>这样试一下~~~~