Created
November 20, 2019 02:55
-
-
Save xbrunosousa/91871e7802f303247f5a7dee382b24d8 to your computer and use it in GitHub Desktop.
Reset form inputs
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<button onclick="reset()">Reset</button> | |
<form id="teste"> | |
<input /> | |
<input /> | |
<input /> | |
<input /> | |
</form> | |
</body> | |
<script> | |
reset = () => document.getElementById('teste').reset(); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment