So let's say I have multiple div's on a page with the ID of "Toggle". and in every div there are two other divs.
- "Headline" This is always visible.
- "Comment" This toggles on/off when the headline is clicked on (default is off).
How would I do this with jquery? I got it working, but only with one on the page.
<script>
$(function() {
$('#toggle').on('click', function () {
$(this).find('#comment').slideToggle(100);
});
});
</script>
(perhaps this is another question, but I would also like the "headline" div's background to be changed to blue when it is clicked (and the comment is dropped down) and revert when "headline" is clicked again, sliding the comments up)