JSFiddle - React, Tailwind, and code Playground
HTML
<p>Try to type</p>
<div data-bind="foreach: users">
<input type="text" data-bind="value: name, valueUpdate: 'afterkeydown', attr: { name: 'Users[' + $index() + ']' }" />
<span data-bind="text: name"></span>
</br>
</div>
<a href="#" data-bind="click: addUser">Add user</a>
<!--
If you submit such form, here is approppriate C# MVC model:
public class ViewModel
{
public List<User> Users { get; set; }
}
public class User
{
public string Name { get; set; }
}
-->
JavaScript
var viewModel = {
users: ko.observableArray(),
addUser: function() {
this.users.push({
name: ko.observable()
});
}
};
viewModel.addUser();
ko.applyBindings(viewModel);