JSFiddle - React, Tailwind, and code Playground

HTML

<div>Places</div>
<br>
<div data-bind="foreach: items">
    <div data-bind="css: { selected: $index() == $root.selectedIndex() }, text: name, click: $root.onIndexSelected.bind($root, $index())"></div>
</div>

CSS

.selected{background-color:red;}

JavaScript

var ViewModel = function() {
    this.selectedIndex = ko.observable(0);
    this.onIndexSelected = function (index) {
        this.selectedIndex(index);
    };
    this.items = [
        {id:1, name: 'Northwoods Prestige'},
        {id:2, name: 'Forest Bay'},
        {id:3, name: 'Timberland'}
    ];
};
var viewModel = new ViewModel();
ko.applyBindings(viewModel);