Last active
November 24, 2019 07:06
-
-
Save raazon/5991f6c193e7449d26f4a096e1109108 to your computer and use it in GitHub Desktop.
Reset form fields by JavaScript
This file contains hidden or 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
// RESET FORM FIELDS BY RAZON | |
function resetFormFieldsValue(formFields){ | |
for(var count = 0; count < formFields.length; count++) { | |
formFields[count].value = ''; | |
} | |
} | |
var formFields = document.querySelectorAll('.checkout input, .checkout select'); // all input & select fields. | |
resetFormFieldsValue(formFields); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment