How to access parent element in backbone view?

In the representations of the Backbone model, it seems to $(this.el).parent()not work. What is the best way to select a parent from a view?

I install el using tagName: "li"for submission.

+5
source share
2 answers

By default, Backbone sets your view to empty div, and you cannot access its parent until it is placed in the DOM through your rendering function.

$(this.el).parent(), Backbone div . this.el.parent(), el jQuery.

+5

this.el? jquery, :

this.el = $('#content');

. , :

this.el.parent()
0

All Articles