[jQuery] SlideToggle a DIV inside another DIV
Hello,
I have a div (gb_results) that includes another div (gb_edit) - when a
button with class "edit" in the gb_results DIV is click I need the
gb_edit DIV to toggle in / out.
The only thing is that the gb_results DIV is generated dynamically
through a database query so I can't name each one as if they were
static. I'm tearing my hair out using different variations of THIS or
NEXT or FIND and not of them work. The only thing I can accomplish is
if any of the "edit" buttons are clicked all of the gb_edit DIV's
appear (shown below).
Please Help!
JQuery Code:
<script type="text/javascript">
$(document).ready(function() {
$(".gb_result .btn-edit").click(function(){
$(".gb_edit").slideToggle();
});
});
</script>
<div class=gb_results">
RESULTS DISPLAYED HERE
<a href="#" class="edit">Edit</a>
<div class="gb_edit">
EDIT CONTENT IN HERE
</div>
</div>