/*
*
* @function: 清空表单的类型为input的文本框、复选框、全选框、select下拉选择框、文本域textarea中的内容
* @param: form为需要清空内容的表单对象
*
*/
function clearForm(form){
$(':input',form).each(function(){
var type = this.type;
var tag = this.tagName.toLowerCase();
if (type == 'text' || type == 'password' || tag == 'textarea') {
this.value = '';
}
if (type == 'checkbox' || type == 'radio') {
this.checked = false;
}
if (tag == 'select') {
this.selectedIndex = 0;
}
})
}