Skip to content

Instantly share code, notes, and snippets.

@glasner
Created November 9, 2011 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save glasner/1351804 to your computer and use it in GitHub Desktop.
Save glasner/1351804 to your computer and use it in GitHub Desktop.
Backbone.View.el
MyView = Backbone.View.extend({
el: '#someElement',
events: {
"click #someButton": "clicked"
},
clicked: function(e){
e.preventDefault();
alert("I was clicked!");
}
});
$(function(){
var myView = new MyView();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment