JSFiddle - React, Tailwind, and code Playground
by db_dev
HTML
<select data-bind="value: selected, foreach: options, enable:box1">
<option data-bind="attr: {value: value}, text: name"></option>
</select>
<select data-bind="enable:box2"></select>
<select data-bind="enable:box3"></select>
JavaScript
function viewModel() {
var self = this;
self.box1 = ko.observable(false);
// self.box2 = ko.observable(false);
self.box3 = ko.observable(false);
self.box2 = ko.computed({
read: function(){
},
write: function(value) {
}
});
self.options = [{
value: 1,
name: "one"
},
{
value: 2,
name: "two"
},
{
value: 3,
name: "three"
}
]
};
ko.applyBindings(viewModel);