jquery 清空表达内容

function clearForm(objE) {
    $(objE).find(':input').each(
        function() {
            switch (this.type) {
            case 'passsword':
            case 'select-multiple':
            case 'select-one':
            case 'text':
            case 'textarea':
                $(this).val('');
                break;
            case 'checkbox':
            case 'radio':
                this.checked = false;
            }
        }
    );
}
clearForm("表单");
posted @ 2014-10-30 13:51  等待是一生最初的苍老  阅读(215)  评论(0编辑  收藏  举报