<table cellpadding=3 cellspacing=1 bgcolor=#000000 width=200>
<tr><td bgcolor=#FFFFFF><input type=text onkeyup='this.value.length==0?ice.style.display="none":ice.style.display="";ice.innerText=this.value;'>
</td></tr>
<tr><td id=ice style='display:none' bgcolor=#FFFFFf>&nbsp;</td></tr>
</table>

解决方案 »

  1.   


    你说的内容消失是怎么个小时法?搞不清楚你的,要不就setInterval来定时判断文本框内容吧
      

  2.   

    <table cellpadding=3 cellspacing=1 bgcolor=#000000 width=200>
    <tr><td bgcolor=#FFFFFF><input type=file onpropertychange='setImg(this)'>
    </td></tr>
    <tr><td id=ice style='display:none' bgcolor=#FFFFFf>&nbsp;</td></tr>
    </table>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function setImg(file)
    {
    if (ice.innerText.length == 0)
    {
    ice.style.display = "none";
    }
    else
    {
    ice.innerHTML = "<img src="+file.value+">";
    ice.style.display = "";
    }
    }
    //-->
    </SCRIPT>