JSFiddle - React, Tailwind, and code Playground
HTML
<div data-bind="css: { highlighted: highlight }, click: highlight( !highlight() )">
random string
</div>
CSS
.highlighted {
color: #a52a2a;
font-weight: bold;
}
JavaScript
function ViewModel() {
var self = this;
self.highlight = ko.observable(true);
}
ko.applyBindings(new ViewModel());