JSFiddle - React, Tailwind, and code Playground

by robgallen

HTML

<div id="debug">ID</div>

JavaScript

var inherit = (function(){
    var F = function(){};
    return function(C, P) {
        F.prototype = P.prototype;
        C.prototype = new F();
        C.prototype.constructor = C;
    };
}());

function Parent() {
}

Parent.prototype.setId = function (id) {
    this.id(id);
}

Parent.prototype.id = ko.observable(1);

function Child(){
    //this.id = ko.observable();
}

inherit(Child, Parent);

var child = new Child();
child.setId(12);

document.getElementById("debug").innerHTML = child.id();