JSFiddle - React, Tailwind, and code Playground

by deepak sisodiya

HTML

<script src="https://rawgit.com/jashkenas/underscore/1.5.2/underscore-min.js"></script>
<script src="https://rawgit.com/jashkenas/backbone/1.0.0/backbone-min.js"></script>

JavaScript

// backbone.js 4 modal

var alert = function (str) {
    var st = document.createTextNode(str);
    var p = document.createElement('p');
    p.appendChild(st);
    document.querySelector('body').appendChild(p);
}

// By default all methods are public.
Person = Backbone.Model.extend({
    defaults: {
        name: 'Fetus',
        age: 0,
        child: ''
    },
    initialize: function () {
        alert("Welcome to this world");
    },
    adopt: function (newChildsName) {
        this.set({child: newChildsName});
    }
});

var person = new Person({name: "Thomas",age: 67,child: 'Ryan'});

person.adopt('John Resig');
alert(person.get("child"));