Date Added: 14/01/2015

  [code lang="js"] $.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; }); }; How to use: $("#formID").clearForm();

Last Update: Posted by: müslüm ÇEN
Not Commented Yet !
Please login in order to comment . Login