2. Learn backbone.js tutorial from scratch for beginners(Part 4) About el and $el in Backbone.js

C:\Users\Administrator\Desktop\gulp\app.js

var theView = Backbone.View.extend({
	tagName: 'p',
	className: 'classspan',
	id: 'idspan',
	initialize: function() {
		this.$el.html("Hello World");
	}
});
jQuery(document).ready(function($) {
	var page = new theView();
	$('#div1').html(page.$el);
});

Last updated

Navigation

Lionel

@Copyright 2023