<!doctype html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"utf-8"
>
<
title
>
Backbone.js $(jQuery) View
</
title
>
<
style
>
div {
width: 50px;
height: 40px;
margin: 5px;
border: 3px outset green;
float: left;
}
.starthidden {
display: none;
}
</
style
>
<
script
src
=
</
script
>
<
script
src
=
</
script
>
<
script
src
=
type
=
"text/javascript"
>
</
script
>
<
script
src
=
type
=
"text/javascript"
>
</
script
>
</
head
>
<
body
style
=
"background-color:black;"
>
<
h1
style
=
"color:green;"
>GeeksforGeeks</
h1
>
<
button
>Show hidden Elements</
button
>
<
div
></
div
>
<
div
class
=
"hidden"
></
div
>
<
div
></
div
>
<
div
></
div
>
<
div
style
=
"display:none;"
></
div
>
<
script
>
var obj = Backbone.View.extend({
initialize: function () {
$("div:visible").click(function () {
$(this).css("background", "yellow");
});
$("button").click(function () {
$("div:hidden").show("fast");
});
}
});
$("div:visible").click(function () {
$(this).css("background", "yellow");
});
$("button").click(function () {
$("div:hidden").show("fast");
});
var example = new obj();
</
script
>
</
body
>
</
html
>