<input name="sch" type="text" id="sch" class="find" value="搜索" onfocus="sch()" onblur="schlose()" />
当我在body里面加上form后就出错,对象不支持此属性或方法。
去掉form后就没有问题。
当我在body里面加上form后就出错,对象不支持此属性或方法。
去掉form后就没有问题。
解决方案 »
- 问个关于setInterval参数的问题,回复快的话,马上结贴,慢的话,明早结贴
- 请问javascript如何得到一个页面的全部代码?
- 如何自动打开网页
- Javascript利用xmlhttp获得服务器时钟
- 求 点击一链接打开个层,鼠标移开十秒后关闭,或者点击页面其它地方关闭层
- 新手提问,又是一个简单问题。如何使用JS在两个页面之间传值。
- 能否让IE弹出的小窗口不在任务栏上显示?
- 求多选的<select>元素与另一个多选的<select>元素相互移动选项的代码!!!!!!!!!!!!!!!!
- 求和函数问题?来人给分!
- Javascript 脚本怎样判断中文字符?
- 单击浏览器的刷新按钮为什么不触发window.location.reload呢?
- 会Ext的进,在这框架之上在做一个小框架,可实现拖动、收缩。请大虾指点。万分感谢! 能否实现?
{
document.form1("sch").value="";
}
function schlose()
{
if(document.getElementById("sch").value == "")
{
document.getElementById("sch").value = "搜索";
}
}
{
document.getElementById("sch").value="";
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="Ehome.css">
<style type="text/css">
<!--
.STYLE4 {color: #838383}
.STYLE5 {color: #3A494B}
-->
</style>
</head>
<script type="text/javascript">
function sch()
{
document.getElementById("sch").value = "";
}
function schlose()
{
if(document.getElementById("sch").value == "")
{
document.getElementById("sch").value = "搜索";
}
}
function menu(id)
{
for(i=1;i<8;i++)
{
if(i == id)
{
document.getElementById("tbl"+i).style.display = 'block';
document.getElementById("td"+i).innerHTML="<img src='WEB/tag.gif'/>"
}
else
{
document.getElementById("tbl"+i).style.display = 'none';
document.getElementById("td"+i).innerHTML="";
}
}
}
function pattern()
{
for(i=1;i<8;i++)
{
document.getElementById("tbl"+i).style.display = 'none';
}
}
</script>
<body topMargin=0 onload="pattern()">
<form>
<table width="986" height="38" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="400"><span class="STYLE4">品质生活 - 爱家无限</span></td>
<td> </td>
<td align="right"><table width="200" height="20" border="0" cellpadding="0" cellspacing="0" style="margin-top:8px">
<tr>
<td width="65" align="left"><a href="javascript:window.external.AddFavorite('http://www.mstarroom.com','智能家居')">加入收藏</a></td>
<td width="65" align="left"><a onclick="this.style.behavior='url(#default#homepage)';this.sethomepage('http://www.mstarroom.com');return"
href="http://www.mstarroom.com/" false;="false;">设为首页</a></td>
<td width="20" align="left" valign="top"><img src="WEB/home.gif" width="16" height="15"/></td>
<td width="50" align="right"><a href="#">控制后台</a></td>
</tr>
</table> <A href="javascript:window.external.AddFavorite('http://www.mstarroom.com','智能家居')"></A> <A onclick="this.style.behavior='url(#default#homepage)';this.sethomepage('http://www.mstarroom.com');return"
href="http://www.mstarroom.com/" false;="false;"></A><a href="#"> </a></td>
</tr>
</table>
<table width="980" height="53" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:20px">
<tr>
<td width="25"><img src="WEB/navigation_1.gif" width="25" height="53" /></td>
<td width="116" background="WEB/navigation_2.gif" class="logo"> </td>
<td width="648" background="WEB/navigation_2.gif"><table width="648" height="30" border="0" cellpadding="0" cellspacing="0" class="head" style="margin-top:20px">
<tr>
<td width="44" height="18" align="center" valign="top" style="cursor:hand" onmousemove="menu(1)"> </td>
<td width="80" height="18" align="center" valign="top" style="cursor:hand" onmousemove="menu(1)">关于爱得屋</td>
<td width="80" height="18" align="center" valign="top" style="cursor:hand" onmousemove="menu(2)">新闻中心</td>
<td width="80" height="18" align="center" valign="top" style="cursor:hand" onmousemove="menu(3)">产品系列</td>
<td width="80" height="18" align="center" valign="top" style="cursor:hand" onmousemove="menu(4)">解决方案</td>
<td width="80" height="18" align="center" valign="top" style="cursor:hand" onmousemove="menu(5)">项目展示</td>
<td width="80" height="18" align="center" valign="top" style="cursor:hand" onmousemove="menu(6)">销售网络</td>
<td width="80" height="18" align="center" valign="top" style="cursor:hand" onmousemove="menu(7)">客服服务</td>
<td width="44" height="18" align="center" valign="top"> </td>
</tr>
<tr>
<td width="44" align="center"></td>
<td align="center" id="td1"></td>
<td align="center" id="td2"></td>
<td align="center" id="td3"></td>
<td align="center" id="td4"></td>
<td align="center" id="td5"></td>
<td align="center" id="td6"></td>
<td align="center" id="td7"></td>
<td width="44" align="center"> </td>
</tr>
</table>
</td>
<td width="22"><img src="WEB/navigation_3.gif" width="22" height="53" /></td>
<td width="143" background="WEB/navigation_4.gif"><table width="113" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="112" height="30" valign="bottom"><input id="sch" name="sch" class="find" value="搜索" onfocus="sch()" onblur="schlose()"/></td>
</tr>
<tr>
<td height="10"> </td>
</tr>
</table></td>
<td width="25"><img src="WEB/navigation_5.gif" width="25" height="53" /></td>
</tr>
</table>
</form>
</body>
</html>
是不是这句的问题??
有错,缺少对象
和pattern(),然后只看搜索框
function sch1()
{
document.getElementById("sch").value = "";
}<input id="sch" name="sch" class="find" value="搜索" onfocus="sch1()" onblur="schlose()"/>