I have 4 divs and 4 different buttons and i want to hide a particular div when its corresponding button is pressed.
my asp code is
<div class="div2">
<div class="d1" id="one">
<h3 class="h3">First Division</h3>
<hr color="black" />
<p class="text-green">
//some text
</p>
<br />
<asp:Button class="btn" ID="Button1" runat="server" Text="Click Me to Hide" />
</div>
<div class="d1" id="two">
<h3 class="h3">Second Division</h3>
<hr color="black" />
<p class="text-red" >
//some text
</p>
<br />
<asp:Button class="btn" ID="Button2" runat="server" Text="Click Me to Hide" />
</div>
<div class="d1" id="three">
<h3 class="h3">Thrid Division</h3>
<hr color="black" />
<p class="text-blue">
//some text
</p>
<br />
<asp:Button class="btn" ID="Button3" runat="server" Text="Click Me to Hide" />
</div>
<div class="d1" id="four">
<h3 class="h3">Fourth Division</h3>
<hr color="black" />
<p class="text-yellow">
//some text
</p>
<br />
<asp:Button class="btn" ID="Button4" runat="server" Text="Click Me to Hide" />
</div>
and my js code is
$(document).ready(function () {
$("#Button1").click(function () {
$("#one").hide('slow');
});
$("#Button2").click(function () {
$("#two").hide('slow');
});
$("#Button3").click(function () {
$("#three").hide('slow');
});
$("#Button4").click(function () {
$("#four").hide('slow');
});
});
But nothing is happening on button clicks. What is the reason of such error??