JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" placeholder="some text" class="search"/>
<input type="text" placeholder="some text" class="search"/>

JavaScript

$("input").on("keydown",function search(e) {
    if(e.keyCode == 13) {
        alert($(this).val());
    }
});