Created
January 5, 2019 02:27
-
-
Save stephencweiss/249f377ed825a460d80cc4a9e2059010 to your computer and use it in GitHub Desktop.
eventHandler with reset attached to `this`
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
function submitForm (event) { | |
event.preventDefault(); | |
console.log(`Form submitted!`); | |
const name = document.querySelector('[name]').value; | |
console.log(`The name is --> `, name); | |
// Do anything else you want here | |
this.reset(); // <-- Our *new* money line | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment