Created
February 1, 2017 12:49
-
-
Save artursopelnik/2f1bf8e1ca5594ae57de3cde145035e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// input[type="reset"] sucks. Do it manually | |
$(':input', this.form).each(function () { | |
var type = this.type, | |
tag = this.tagName.toLowerCase(); | |
if (type == 'text' || type == 'search' || type == 'password' || tag == 'textarea') { | |
this.value = ""; | |
} else if (type == 'checkbox' || type == 'radio') { | |
this.checked = false; | |
} else if (tag == 'select') { | |
this.selectedIndex = -1; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment