Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 = "";
- else if (type == 'checkbox' || type == 'radio')
- this.checked = false;
- else if (tag == 'select')
- this.selectedIndex = ‐1;
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement