clear all fields in form javascript
document.querySelector("form").reset();<!DOCTYPE html>
<html>
<body>
<p>Enter some text in the fields below, then press the "Reset form" button to reset the form.</p>
<form id="myForm">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br><br>
<input type="button" onclick="myFunction()" value="Reset form">
</form>
<script>
function myFunction() {
document.getElementById("myForm").reset();
}
</script>
</body>
</html>
Also in JavaScript:
- unordered list in react native
- digit count in javascript
- use two div id in jquery
- stop window.setinterval javascript
- jsx classname multiple
- getrect javascript
- lodash filter object keys
- how to get the value of textarea in react
- get local time second javascript heure temps réel
- get actual url in variable
- no styles are appearing in angular calendar
- store current date in chrome storage extension
- random numbers javascript
- vscode new file shortcut
- show ad on facebook game
- exceljs read file
- javascript user agent detection
- javascript data em portugues
- share link in express js
- react native status bar
- express img folder
- diffrence of two objects javascript
- assign freemarker expressions to variables
- npm start react