JSFiddle - React, Tailwind, and code Playground

HTML

<div data-bind="css: { highlighted: highlight }, toggleClick: highlight">
    random string
</div>

CSS

.highlighted {
    color: #a52a2a;
    font-weight: bold;
}

JavaScript

ko.bindingHandlers.toggleClick = {
    init: function (element, valueAccessor) {
        var value = valueAccessor();

        ko.utils.registerEventHandler(element, "click", function () {
            value(!value());
        });
    }
};

function ViewModel() {
    var self = this;
    self.highlight = ko.observable(true);   
}

ko.applyBindings(new ViewModel());