Backbone Testbed

This is my own backbone setup which includes all the needed files to run this fiddle Download these files from following location and you have your own fiddle that runs the backbone code :) http://documentcloud.github.com/underscore/underscore-min.js http://documentcloud.github.com/backbone/backbone-min.js https://raw.github.com/derickbailey/backbone.modelbinding/master/backbone.modelbinding.min.js

by scriptstar

HTML

<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone-min.js"></script>
<script src="https://raw.github.com/derickbailey/backbone.modelbinding/master/backbone.modelbinding.min.js"></script>
<button id="btn">Click Me</button>
<div id="content"></div>

CSS

li {
    padding: 5px;
    margin: 5px;
    background-color: rgb(240,240,240);
    border: 1px rgb(200,200,200) solid;
    border-radius: 5px;
    list-style-type:none;
}

button {
    padding: 5px;
}

JavaScript

$(document).ready(function () {

   var MsgView = Backbone.View.extend({
        events : {
            'click #btn' : 'btnClick'
        },
        btnClick: function () {
            $('#content', this.el).append('<li>Yeah It\'s work ! Great work, thanks :)</li>');  
        }
    });

   var msgView = new MsgView ({ el : $('body') });

});