Backbone sample environment

HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.5.3/backbone-min.js"></script>
<script src="ttps://code.jquery.com/jquery-2.2.4.min.js"></script>

<div class="search">
<form action="" method="post">
<input type="text"> <input type="submit">
</form>
</div>

JavaScript

window.app = {};

window.app.SearchView = Backbone.View.extend({
    el: $(".search"),
    
    events: {
        "change [type=text]": "onTextChange",
        "submit form" : "submit"
    },
   
    initialize: function() {
    		this.setElement('.search');
    		this.$input = this.$el.find("[type=text]");
    },
    
    submit: function(event) {
    		event.preventDefault();
    		alert('vous avez recherchez ' + this.$input.val());
    },
    
    onTextChange: function(event) {
    	console.log('text change');
    },
    
    render: function() {
       return this;
    },
});

$(document).ready(function () {

    new window.app.SearchView();
});