日期:2014-05-16 浏览次数:20346 次
<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>