Target all elements inside div except one...
Hi there,
I have this code in a js file:
- $(document).ready(function(){
- $(".accordion p").hide();
- $(".accordion div").click(function(){
-
- $(this).next("p").slideToggle("slow")
-
- });
- });
... and this code in my HTML file:
- <div class="outer">
- <div class="article_name">
- <h2><a href="#">Should Comment Forms Have More Fields?</a></h2>
- </div>
- <div class="article_date">
- Feb 11th 2010
- </div>
- <div class="article_category">
- Discussion
- </div>
- </div>
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
I'd like that when I click the outer div, p is shown (it's working). But I'd also like, that when the H2 link is clicked, p doesn't show - instead it should follow the link. How can I do that?
Thanks!