JSFiddle - React, Tailwind, and code Playground

by madcapnmckay

HTML

<script src="http://cloud.github.com/downloads/SteveSanderson/knockout/knockout-2.0.0.js"></script>
<div id="buttonList">
</div>

<button data-bind="click: makeUI">Add a button</button>

JavaScript

var system = function()
{
    var self = this,
        $list = document.getElementById("buttonList");
    
    this.hello = function()
    {
        alert("hello");
    }  
        
    this.makeUI = function(container)
    {      
        var div = document.createElement("div");
        div.innerHTML = "<button data-bind='click: hello'>Click</button>";
        
        $list.appendChild(div);
    
        ko.applyBindings(new system(), div);
    }
}

ko.applyBindings(new system());