JSFiddle - React, Tailwind, and code Playground
HTML
<h3>Diagnosis Codes<input type="button" value="Add" data-bind="click:AddDiagnosisCode"/></h3>
<div data-bind="foreach:DiagnosisCodes">
<div><input type="text" data-bind="value:$data, hasFocus: true">
</div>
</div>
JavaScript
var DiagnosisViewModel = function()
{
var self = this;
self.DiagnosisCodes = ko.observableArray();
self.AddDiagnosisCode = function()
{
self.DiagnosisCodes.push("");
}
}
ko.applyBindings(new DiagnosisViewModel());