What is the difference between $el and el in Backbone.js views?
问题 Can you please tell the difference between $el and el in Backbone.js views? 回答1: lets say that you do this var myel = this.el; // here what you have is the html element, //you will be able to access(read/modify) the html //properties of this element, with this var my$el = this.$el; // you will have the element but //with all of the functions that jQuery provides like, //hide,show etc, its the equivalent of $('#myel').show(); //$('#myel').hide(); so this.$el keeps a reference to your //element