我使用下面的代码使用Jquery来设置我的表单字段
$("#frmlogin").reset()
Run Code Online (Sandbox Code Playgroud)
上面是我用来重置下面表单中的字段的代码
<form name='frmlogin' method='POST' id="login_form" style="margin:0 auto; margin-top:50px; width: 40%; height:300px; text-align:center;">
<input class="oFormJumbo oFormMed oInputText" type="text" name="requiredLogin" placeholder="Login Id" AUTOCOMPLETE=OFF />
<div class="cleaner h10"></div>
<input class="oFormJumbo oFormMed oInputText " type="password" value="" name="password" placeholder="Password" AUTOCOMPLETE=OFF onfocus="changetoUpperCase(document.frmlogin.requiredLogin.value);" />
<div class="cleaner h10"></div>
<a href="javascript:fp();">Forgot Password?</a>
<div class="cleaner"></div>
<input style="margin-left:0px; " class="submit_btn float_l" type="button" value="Sign In" name="Sign In" onClick="javascript:func_get_data();"/>
<input style="margin-left: 200px; " class="submit_btn float_r" type="button" value="Reset" id="reset" name="reset" onclick="javascript:Reset()"/>
</form>
Run Code Online (Sandbox Code Playgroud)
由于某种原因,代码无法正常工作.JavaScript抛出以下异常
TypeError: $("#frmlogin").reset is not a function
[Break On This …Run Code Online (Sandbox Code Playgroud)