一個javascript的基础问题,变量的连接问題.谢谢!!
下面這个变量i的连接写法有问题,请问各位如何写这个连接?
<script language= "javascript ">
<!--
for(var i=1;i <=theForm.cardcount.value;i++)
{
if (theForm.cardid+i.value == " ")
{
alert( "请输入关卡数! ");
theForm.cardid+i.focus();
return (false);
}
}
-->
</script>
------解决方案--------------------try
eval( "cardid "+i)
------解决方案--------------------o = document.getElementById( "cardid "+i).focus();