Javatpoint Logo
Javatpoint Logo

Backbone.js view.setElement()

The Backbone.js setElement method is used to apply backbone view to a different DOM element. It also creates a cached $el reference and displaces the view's delegated events from the old element to the new one.

Syntax:

Parameter explanation:

element: It specifies an element that can be changed from existing element to different element.

Let's take an example.

See this example:

Test it Now

Output:

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

BackboneJS setelement Model1

Enter any text and you will get the following result.

BackboneJS setelement Model2




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