I tried implementing the example from the Backbone manual, but it doesn't seem to be working as expected.
var View = Backbone.View.extend({
tagName: 'li'
});
var ex_view = new View();
console.log(ex_view.el);
This code snippet throws an error:
TypeError: invalid 'in' operand n
However, when I made a small change and used this code instead:
var ex_view = new Backbone.View({
tagName: 'li'
});
console.log(ex_view.el);
The console output was:
<li>
Why is the example from the manual not working properly? And why does my modified code not show the closing tag in the console?