if (tag == 'td' && $(this).hasClass('status')) {
// I am clearing everything inside the td with class status
$(this).html('')
}
但它似乎并不清楚...任何建议...这是一个有效的jQuery条件语句?
我定制表单插件,
$.fn.clearForm = function() {
return this.each(function() {
var type = this.type, tag = this.tagName.toLowerCase();
if (tag == 'form')
return $(':input', this).clearForm();
if (type == 'text' || type == 'password' || tag == 'textarea')
this.value = '';
else if (type == 'checkbox' || type == 'radio')
this.checked = false;
else if (tag == 'select')
this.selectedIndex = -1;
else if (tag == 'td' && $(this).hasClass('status')) {
// if you want to remove everything, use this
$(this).html('');
}
});
};
@Alconja任何其他的可能性... – 2010-05-20 04:27:46
@Pandiya:你怎么打电话给插件? – Alconja 2010-05-20 04:31:48
@alconja'$(“#addform”)。clearForm();' – 2010-05-20 04:33:14