My problem is that i have 2 jquery toggle, the upper one works perfectly why the lower one's doesn't respond because of the HTML repetition is there any way to make all of them work without changing the class or id (eg: i don't want to be changing code each time i need a toggle)
JS
$(document).ready(function(){
$("#flip").click(function(){
$("#panel").slideToggle("slow");
});
});
CSS
#panel,#flip
{
padding:5px;
text-align:center;
background-color:#e5eecc;
border:solid 1px #c3c3c3;
}
#panel
{
padding:50px;
display:none;
}
HTML
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
<div id="flip">Click to slide the panel down or up</div>
<div id="panel">Hello world!</div>
<p>
<div id="flip">Click to slide the panel down or up</div>
<div id="panel">Hello world!</div>
<p>
<div id="flip">Click to slide the panel down or up</div>
<div id="panel">Hello world!</div>