JSFiddle - React, Tailwind, and code Playground

by psoares

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.3/dojo/resources/dojo.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.3/dijit/themes/claro/claro.css">
<div id="foo"></div>
<button id="btn1"></button>

JavaScript

require(["dojo/_base/declare", "dijit/form/Button", "dojo/html", "dijit/_WidgetBase"],

function (declare, Button, html, _WidgetBase) {

    var Widget = declare(_WidgetBase, {
        templateString: "<div data-dojo-attach-point='containerNode' data-dojo-attach-event='onchange:onChange'>${value}</div>",

        value: "foo",

        postCreate: function () {
            this.inherited(arguments);
            this.watch("value", function (attr, oldVal, newVal) {
                html.set("output", this.get("value"));
            });
        }
    }),


        w = new Widget({
            value: "foo"
        }, "foo"),
        btn1 = new Button({
            label: "OK"
        }, "btn1");
    btn1.on("click", function () {
        w.set("value", "bar");
    });

    w.startup();
    btn1.startup()


});