JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" class="Submit" value="Submit"/>
<!--<input type="button" class="Search" value="Search"/>-->
<input type="text" class="Search" value="Search"/>
JavaScript
$("input.Submit").keypress(function(event){
if(event.which=='13'){
alert("Key enter key entered ");
event.preventDefault();
}else{
event.preventDefault();
}
}).click(function(event){
alert("Here is the submit Button works on click write jquery ");
$( "#FormId" ).submit();
});
$("input.Search").keypress(function(event){
//alert("Works for both enter ");
if(event.which=='13'){
alert("Key enter key entered ");
}
});