JSFiddle - React, Tailwind, and code Playground

by hunkyhari

HTML

<form name="qualification" id="qual">
    <fieldset id="pair1">
        <input type="text" name="school1"/>
        <input type="text" name="degree1"/>
    </fieldset>
    <button id='add'>Add Another</button>
</form>

JavaScript

$('#add').click(function(){
var nextIndex = $('#qual > fieldset').length+1;
var next_row='<fieldset id="pair'+nextIndex+'"><input type="text" name="school'+nextIndex+'"/><input type="text" name="degree'+nextIndex+'"/></fieldset>';
$('#qual').append(next_row);
return false;
});