reset是复位,不是清空,你应该明白这个单词的意思
解决方案 »
- 图片切换出错
- js变量作用域的问题
- struts+jquery报错$("#remotetabs").tabs is not a function什么情况啊?
- innerHTML‘这儿的js代码不能执行,跪求解释’;
- jquery 怎么通过子元素找父元素
- 关于不同的frame改变窗口显示的问题
- 小妹有个简单的问题 判断上下密码填写一致的代码
- 如何给WORD增加一个toolsbar,再加上多个BUTTON??如何实现?
- 我的循环怎么了?
- 正则表达式问题
- 请教高手一个EMAIL验证的问题。
- 检验email,当有多个文本框可以输入email地址,当我在判断地址是否正确时,为什么每个都要判断,连空的也判断
1.如果原来有数据,回到原来是什么数据就还显示什么数据
2.如果原来没有数据,这时就相当于清空了
Return ValueNo return value.ResThe reset method fires the onreset event on the form.ExampleThis example demonstrates how to use the reset method for a form object. When the button is pressed, the form is reset, resulting in the onreset event call on the form object. The onreset event calls an event handler which in turn adds the text Resetting form. to the text area below.HideExample<HTML>
<HEAD>
<SCRIPT>
function doReset(){
oTextArea1.value += "Resetting form. ";
}
</SCRIPT>
</HEAD>
<BODY>
<DIV id="oDiv1"
style="border:1px solid black; background:#EEEEEE; padding:10px;">
<B>Form</B>
<FORM name="form1" onreset="doReset();">
<b>Enter some text:</b> <INPUT type="text" name="oText1" value=""><BR><BR>
<BUTTON onclick="form.reset();">form.reset()</BUTTON>
</FORM>
</DIV>
<B>Text area</B><BR>
<TEXTAREA id="oTextArea1" value="" rows="5" cols="75"></TEXTAREA>
</BODY>
</HTML>
Show Me
Standards InformationThis method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 . Applies To[ Object Name ]
Platform Version
Win16:
Win32:
Windows CE:
Unix:
Mac:
Version data is listed when the mouse hovers over a link, or the link has focus.
FORM
Move the mouse pointer over an element in the Applies To list to display availability information for the listed platforms.
function FormReset(theform){
//theform is the form's name
if(theform=="")
return false;
if(document.forms(theform) != undefined)
document.forms(theform).reset();
}</script>
<body>
<form>
<script>
var win=window.open("about:blank","","")
win.document.write("<input type=button onclick='window.parent.document.getElementsByTagName(\'FORM\')[0].reset()'>")
</script>
<input type=text id='test'>
</form>
</body>
</html>