JSFiddle - React, Tailwind, and code Playground

by tamtakoe

HTML

<div id="cont"></div>

JavaScript

var additem = function () {
  
      var $item = $('<div><input type="text"></div>')
      $item.find('input').on( 'keyup.additem', function(e){
        additem()
      })
      $item.appendTo('#cont')
      $('#cont').children().eq(-2).off('keyup.additem')
    
}
additem()