I'm trying to wrap my head around this concept.
Can you dumb this down for me and maybe provide a simple example of the difference between the el:
attribute and the tagName:
attribute?
In some examples, different views use el:
sometimes and others use tagName:
.
I'm specifically messing around with my own implementation of this example
I think that should work fine.
The difference is this:
el should be used to preserve a reference to the actual DOM node representing the view as a whole.
This means you can easily perform actions on it with jQuery or w/e. $(this.el).hide() or $(this.el).html('I am a Jquery Object now');
TagName is only a string that is used to determine the type of DOM node el will be. The default is div, but if you wanted, you could make it any HTML element you please.
Consider:
The problem you might be running into is that sometimes you set el on the instantiation of a view, in which case the tagName is irrelevant: