天天看點

jQuery清空文本框的值

<table class="ke-zeroborder" labelcanva="true" border="0" cellpadding="0" cellspacing="0">

        <tbody>

            <tr>

                <td class="f_name">

                    <span class="form_err">*</span>使用者名:

                </td>

                <td>

                    <input id="txtName" class="text" name="loginname" /> 

            </tr>

                    <span class="form_err">*</span>密 碼:

                    <input class="text" id="txtpwd"  name="password" type="password" /><!--<a class="a_pw" href="#">忘記密碼?</a> -->

                    <span class="form_err">*</span>驗證碼:

                    <input class="text" id="txtcode" name="validator" maxlength="4" /><span class="code"><img src="checkcode.ashx" onclick="this.src=this.src+'?'" /></span> 

            <tr style="display:none;">

                     

                    <input name="autologin" type="checkbox" />下次自動登入

                    <a class="a_login" href="javascript:;" commandbutton="login">登入</a>  <a class="a_reg" href="#">重置</a> 

        </tbody>

    </table>

</div>

<script type="text/javascript">

    $(".product_tablebg").click(function () {

        $(this).remove();

        $(".product_tablek").remove();

    })

    $(".product_tablek .span").click(function () {

        $(".product_tablebg").remove();

    $(".a_reg").click(function () {

        $("#txtName").attr("value", "");

        $("#txtpwd").attr("value", "");

        $("#txtcode").attr("value", "");

</script>

本文轉自程式猿部落格51CTO部落格,原文連結http://blog.51cto.com/haihuiwei/1587885如需轉載請自行聯系原作者

365850153

繼續閱讀