How do I delete a section of a jQuery accordion?

alastairburiss

New Member
So, I have an accordion menu and in each div I have a red square. I'm trying to make it so that when I click the red square that particular div and the < h3 > link all disappear. I can get the div to go, but the title always stays, and I'm not sure how to select and remove it. Thanks as always. My HTML: \[code\]<div id="accordion"> <h3><a href="http://stackoverflow.com/questions/12807668/#">Section 1</a></h3> <div class="squares"> <a href="http://stackoverflow.com/questions/12807668/#" class="green">1</a> <a href="http://stackoverflow.com/questions/12807668/#"class="red">2</a> <a href="http://stackoverflow.com/questions/12807668/#" class="blue">3</a> <p> Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate. </p> </div></div>\[/code\]And here is my JS: \[code\]$('document').ready(function(){ $('#accordion .red').click(function(){ $(this).parent('div').remove(); return false; });});\[/code\]
 
Back
Top