PDA

View Full Version : Change class of active header of accordian


indianleo
07-22-2013, 07:45 AM
Hi Friends I had created one accordian now I want to change class of active header
I want to change class of Active hr from header to active-header in javascript pls do guide me
Code

<script type="text/javascript">
$(document).ready(function() {
$("#accordion .header").click(function() {
if($(this).next("div").is(":visible")){
$(this).next("div").slideUp("slow");
} else {
$("#accordion .content").slideUp("slow");
$(this).next("div").slideToggle("slow");
}
});
});
</script>

<div id="accordion">
<h3 class="header">Header</h3>
<div class="content">
Content
</div>
<h3 class="header">Header</h3>
<div class="content">
Content
</div>
</div>

indianleo
07-22-2013, 08:26 AM
Please need help urgently