Is there a way to automatically reset the textbox when submitting a value? Below is my code:
<!DOCTYPE html>
<html>
<body>
<ul id="myList">
</ul>
<input type="text" id="myText" value="">
<button onclick="myFunction()">Submit</button>
<script>
function myFunction() {
var element = document.createElement("li");
var textnode = document.createTextNode(myText.value);
element.appendChild(textnode);
var list = document.getElementById("myList");
list.insertBefore(element, list.childNodes[0]);
}
</script>
</body>
</html>