JSFiddle - React, Tailwind, and code Playground

by inser

HTML

<input type='text' id='txtBarcode' />
<input type='button' id='btnBarcode' value='click' />

JavaScript

$(document).ready(function () {

    $("#txtBarcode").focus();
    $("#btnBarcode").click(getBarcode);    

    $('#txtBarcode').live("keyup", function (event) {
        if (event.keyCode == '13') {
            getBarcode();
        }
    });
});

function getBarcode() {
    alert('pressed');
}