here i have a form with a text area.I had a keyup event attach to the text area.While giving input t o the text area with one finger i press down the key and with other hand i click the submit button.So the scenario is the form gets submitted while giving input to the text area.How can i prevent that from happening ?
<html>
<body>
<form action='sample.php' method='post'>
<input type='text' id='mytext' value=''>
<input type='submit' value='submit'>
</form>
<script>
document.getElementById('mytext').addEventListener('keyup',function(){
console.log("keyup");
})
</script>
</body>
</html>