JSFiddle - React, Tailwind, and code Playground

HTML

<input id="tags">

JavaScript

$('#tags').keyup(function(e){
    var code = e.which ? e.which : e.keyCode;
     console.log(code);
    if (code === 110){
        var input = this.value;
        input = input.substr(0, input.length -1);
        console.log(input);
        input += ',';
        this.value = input;        
    }

});