JSFiddle - React, Tailwind, and code Playground

HTML

<div id="a" data-bind="html: code">
    this text is replaced by the JavaScript
</div>

JavaScript

function AppView() {
    var self = this;
    self.code = ko.observable('<div>this shouldnt show</div>');
    self.stuff = ko.observable('this should show');
}

var app = new AppView();
ko.applyBindings(app);

// Later
app.code('<div data-bind="text: stuff">this shouldnt show either</div>');