Javatpoint Logo
Javatpoint Logo

Backbone.js View Constructor / Initialize

The Backbone.js view Constructor is called when the view is first created. It initializes the view. It uses new keyword and get called when the view is created. It is one of the several special options that will be attached directly to the view.

Syntax:

Parameter explanation:

options: It is optional. It can be model, collection, id, className, tagName, attributes, and events.

Let's take an example.

See this example:

Test it Now

Output:

Save the above code in initialize.html file and open this file in a new browser.

BackboneJS initialize Model
Next TopicBackbone.js el





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA