JSFiddle - React, Tailwind, and code Playground
HTML
<div class="editor-field">
<select data-bind="options: propertyTypeList, value: selectedPropertyType, optionsCaption: 'select property type...'"></select>
</div>
<div class="editor-label" data-bind="visible: isVisible('Area')">Area</div>
<div class="editor-label" data-bind="visible: isVisible('Bedroom')">Bedroom</div>
JavaScript
function ViewModel() {
var self = this;
self.propertyTypeList = ko.observableArray(['Area', 'Bedroom', 'Other']);
self.selectedPropertyType = ko.observable("");
self.visibleFeatures = ko.observableArray([]);
self.isVisible = function (type) {
//Your logic here
return self.selectedPropertyType() === type;
};
};
ko.applyBindings(new ViewModel());