this.checked = ko.observable(value); this.disabled = ko.observable(false); // display checked state. this.getState = function () { alert("Checked: " + this.checked()); } // check checkbox. this.check = function () { this.checked(true); } // toggle disabled state. this.toggle = function () { this.count++; this.disabled(this.count % 2); } }; ko.applyBindings(new viewModel(true)); });