> For the complete documentation index, see [llms.txt](https://javascriptuse.gitbook.io/advanced/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://javascriptuse.gitbook.io/advanced/backbone.js-tutorial-9-views-using-the-render-function-ok.md).

# Backbone.js Tutorial - 9 - (Views) Using the Render Function (ok)

![](https://2726517656-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1E4Gk2ppVKb4olmnun%2F-MS1VtkL-1qDdwEW2yVl%2F-MS1cUJPjHCqW9rGizZS%2FScreenshot_7.jpg?alt=media\&token=798eca72-0032-49ba-a551-e43ecc2818b8)

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

```
var theView = Backbone.View.extend({
	initialize: function() {
		this.render();
 	},
	render: function() {
		var template = _.template($("#ourTemplate").html(),{});
		this.$el.html(template);
	}
});
jQuery(document).ready(function($) {
	var page = new theView({el: $("#div1")});
});
```

C:\Users\Administrator\Desktop\gulp\index.html

```
<!DOCTYPE html>
<html>
<head>
  <title>Backbone Example</title>
  <link rel="stylesheet" href="lib\css\todos.css" />
  <script src="lib/js/jquery-1.9.1.js"></script>
  <script src="lib/js/underscore.js"></script>
  <script src="lib/js/backbone.js"></script>
  <script src="app.js"></script>
  <script type="text/template" id="ourTemplate">
    <h1>Hello 1</h1>
    <h2>Hello 2</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adip</p>
  </script>
</head>
<body>
  <div id="div1"></div>
</body>
</html>
```
