We just learned that views have templates that they render into DOM. Applications that need to do this manually will need to utilize the view instance
appendTo method, as shown in the following example:
This method takes a jQuery query selector that we are already used to, as shown in the following examples:
view.appendTo('header'); view.appendTo('#header'); view.appendTo('.header'); view.appendTo('body > header');
Note that only one matched element is used. Therefore, in the third example, the view will be inserted into the last
header element found.
As a convenience, views have an
append method that can be used to insert the views directly into the body section of DOM:
view.append(); // appends view ...