1<form>
2 <input id="myInput" placeholder="Some text.." value="">
3 <input type="submit" id="myBtn" value="Submit">
4</form>
5
6<script>
7var input = document.getElementById("myInput");
8input.addEventListener("keyup", function(event) {
9 if (event.keyCode === 13) {
10 event.preventDefault();
11 document.getElementById("myBtn").click();
12 }
13});
14</script>
15