JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cloud.github.com/downloads/SteveSanderson/knockout/knockout-2.1.0.js"></script>
<button data-bind="click: add">Add</button>
<table data-bind="foreach: items">
<tr>
<td data-bind="text: name"></td>
<td><button data-bind="click: $root.remove">Remove</button></td>
<tr>
</table>
JavaScript
MyApp = {};
MyApp.ViewModel = function() {
this.items = ko.observableArray();
};
MyApp.ViewModel.prototype = {
add: function() {
this.items.push({ name: ko.observable("Tuckel")});
},
remove: function(item) {
this.items.remove(item);
}
};
ko.applyBindings(new MyApp.ViewModel());