日期:2014-05-16  浏览次数:20346 次

button按钮按完就消失了,如何才能让它再次出现
<input type="button" onclick="chazhao(3)" value="查找" />

按钮点一次就消失,我想让他再次出现,如何实现?

------解决方案--------------------

<script language="javascript">
function chazhao(number)
{
    var a=new Array(1,2,3,4,5,6,7,8,9,0);
    document.write(isCon(a, number));
    document.write('<input type="button" onclick="chazhao(3)" value="查找" />');
    function isCon(a, number)
    {
        for(var i=0; i<a.length; i++)
        {
            if(a[i] === number)
            {
                return String(true);
            }
        }
        return String(false);
    }
}
 
</script>
 
<input type="button" onclick="chazhao(3)" value="查找" />

------解决方案--------------------

<script language="javascript">
function chazhao(number)
{
    var a=new Array(1,2,3,4,5,6,7,8,9,0);
    document.getElementById('tips').innerHTML = isCon(a, number);
    function isCon(a, number)
    {
        for(var i=0; i<a.length; i++)
        {
            if(a[i] === number)
            {
                return String(true);
            }
        }
        return String(false);
    }
}
</script> 
<input type="button" onclick="chazhao(3)" value="查找" />
<div id="tips"></div>