JSFiddle - React, Tailwind, and code Playground

by JKurcik

HTML

<div id="option-wrapper">
    <input type='text' name='options[]' class='options' />
    <br/>
    <br/>
    <input type='text' name='options[]' class='options' />
</div>

JavaScript

var wrapper = $("#option-wrapper");

var bindClickEvents = function () {
    var options = $(".options",wrapper);
    options.unbind("click");
    options.last().on("click", function() {
        $(this).after("<br/><br/><input type='text' name='options[]' class='options'>");
        bindClickEvents();
    });
};
bindClickEvents();