title: Backbone - Change tagName on condition
body: <p>I'm trying to switch the tagName of a Backbone view based on a condition.</p>
  
  <p>I initially thought I would be able to set a default tagName of say 'div' (I realize this is the default), then in the view's initialize function, check for the condition and change the tagName but this unfortunately didn't work.</p>
  
  <p>Here is my view code (written in coffeescript):</p>
  
  <pre><code>  class Test.Views.ListView extends Backbone.View
      attributes: {"data-role": "listview"}
      className: 'row'
      tagName: 'div'
      initialize: -&gt;
        if @options and @options.device == "mobile"
          @template = "/app/templates/mobile/test/test.html" 
          @tagName = 'ul'
  </code></pre>
  
  <p>With this code, the tagName does not change, it always remains a div. While the template is switched correctly.</p>
  
  <p>Any help would be appreciated.  Cheers!</p>