JSFiddle - React, Tailwind, and code Playground
by Vipin Patil
HTML
Form : track enter button
<form name="loginBox" target="#here" method="post">
<input name="username" type="text" /><br />
<input name="password" type="password" />
<input type="submit" />
</form>
JavaScript
$(function() {
$('form').each(function() {
$(this).find('input').keypress(function(e) {
// Enter pressed?
if(e.which == 10 || e.which == 13) {
this.form.submit();
alert("enter pressed")
}
});
$(this).find('input[type=submit]').hide();
});
});