JSFiddle - React, Tailwind, and code Playground

by ksoncan34

HTML

<input id="nameField" type="text"/>

JavaScript

var test;
(function (test) {
    var EmployeeController = (function () {
        function EmployeeController(name) {
            var _this = this;
            this.name = name;
            $('#nameField').val(name).on('blur', function (e) {
                _this.nameFieldChanged(e);
            });
        }
        EmployeeController.prototype.nameFieldChanged = function (e) {
            this.name = $(e.currentTarget).val();
            this.outputName();
        };
        EmployeeController.prototype.outputName = function () {
            console.log(this.name);
        };
        return EmployeeController;
    }());
    var tmp = new EmployeeController('John Doe');
})(test || (test = {}));