Javatpoint Logo
Javatpoint Logo

Backbone.js view.$()

The Backbone.js $(jQuery) method is used to run queries scoped within the view's element. After using this, you don't have to use model ids within your query to fetch specific elements in a list, and can rely much more on HTML class attributes. It is same as running: view.$el.find(selector)

Syntax:

Parameter explanation:

selector: It specifies the different types of selectors i.e. id or class.

Let's take an example.

See this example:

Test it Now

Output:

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

BackboneJS jquery Model1

Click on the button, you will see the following:

BackboneJS jquery 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