title: event.target.id as undefined ? Creating dynamic buttons using backbone.js
body: <p>I have a <code>section</code> element with <code>id = wrapper</code>. In my router I add <code>.delegate()</code> jQuery method to delegate events to dynamically created buttons (as traditional <code>events:{"click button" : "gotoSomeMethod"}</code> is not working for me).</p>
  
  <pre><code> $(document).ready(function() {
   window.App = new window.Routers.Package;
   Backbone.history.start();              
  
     $('#wrapper').delegate("button", "click", function(ev){
        alert ($(ev.target).id); 
     });
  });
  </code></pre>
  
  <p>Here is my view,</p>
  
  <pre><code>window.Views.Actions = Backbone.View.extend({
  tag: 'nav',
  
  initialize: function() {
      _.bindAll(this, 'render', 'gotoNode');
  
  
  },
  
  render:function(){
      this.model.each(function(action){
          var buttonTemplate = "&lt;button id = '"  + action.toNodeId + "'&gt;" + action.name + "     &lt;/button&gt;";
          $(this.el).append(buttonTemplate)
      }, this);
  
  
      console.log(this.el); // when I do this I get `&lt;div&gt;&lt;button id = 'something'&gt;&lt;/button&gt;&lt;/div&gt;`
      return this;
  },
  
     events:{
        "click button":"gotoNode"  
     },
  
     gotoNode:function() {
       alert("inside gotoNode");  
     },
  
  });
  </code></pre>
  
  <p>So the first issue here is why I get undefined as an for <code>id</code>? Secondly, how do I make backbone to call <code>gotoNode()</code> method?</p>