<script>
function begin(obj1,obj2)
{
var index=obj2.replace(/day_/,"")
alert("hell"+index)
}</script><form action="" name=myform>
<div id='total_0' style='display:none'>hell0</div>
<input type=text name='day[]' id=day_0 size=5 onfocus="begin(this.form,this.id);" >
<div id='total_1' style='display:none'>hell1</div>
<input type=text name='day[]' id=day_1 size=5 onfocus="begin(this.form,this.id);" 
>
<div id='total_2' style='display:none'>hell2</div>
<input type=text name='day[]' id=day_2 size=5 onfocus="begin(this.form,this.id);" 
></form>

解决方案 »

  1.   

    楼上hbhbhbhbhb1021(天外水火(我要多努力)) 误解楼主的意思了。
    楼主是说让隐藏在div中的hello0~hello2显示出来,不是alert,呵呵~~~
      

  2.   

    多谢,
    我想要的是 这个。
    function begin(obj1,obj2)
    {
    var index=obj2.replace(/day_/,"")
    //alert("hell"+index)
    document.getElementById("total_"+index).style.display="";
    }