JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cdnjs.cloudflare.com/ajax/libs/knockout/2.2.1/knockout-min.js"></script>
<div id="data">
<span data-bind="text: firstName"></span>
<span data-bind="text: lastName"></span>
<input type="checkbox" data-bind="checked: isCustomer" title="Is a customer" />
<input name="x" type="radio" data-bind="checked: employeeType" value="TypeA" title="Employee type A" />
<input name="x" type="radio" data-bind="checked: employeeType" value="TypeB" title="Employee type B" />
</div>
JavaScript
var PersonViewModel = function()
{
this.firstName = ko.observable('Lisa');
this.lastName = ko.observable('T');
this.isCustomer = ko.observable(true);
this.employeeTypeA = ko.observable(false);
this.employeeTypeB = ko.observable(true);
this.employeeType = ko.computed(function()
{
if (this.employeeTypeA())
return 'TypeA';
if (this.employeeTypeB())
return 'TypeB';
},this);
};
var personViewModel = new PersonViewModel();
ko.applyBindings(personViewModel, $('data').get(0));