如何判断页面上是否存在某个控件? try{document.all("a").text="dd";}catch(ex){notfound=true;}不知你的想法正常是把代码放在onload中,控件一定存在 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <input type="text" name="txt" value="灰豆宝宝.net"><input type="button" onclick="check()" value="Check"><script>function check(){ if(document.getElementById('txt')) { alert(document.getElementById('txt').value); }}</script> div移动不了 JS搜索提示如何按照从左到右检索! js错误 marquePic2未定义 jquery $(document).ready()理解问题 看下Math函数 关于复试计算讨论 请教高手表单内容为数字范围的实时校验如何实现 求大侠帮忙挖一段代码 ie5和ie6的问题,在线等待,分不够还可以在给 运行这个程序!进来看看 急求助!!关于判断的! 大家看看这段代码???display="none"?
<input type="button" onclick="check()" value="Check">
<script>
function check()
{
if(document.getElementById('txt'))
{
alert(document.getElementById('txt').value);
}
}
</script>