---
title: "How to toggle next hidden div on click"  
description: "How to toggle next hidden div on click"  
author: "Anonymous User"  
published: 2015-01-28  
updated: 2015-01-28  
canonical: https://www.mindstick.com/forum/12909/how-to-toggle-next-hidden-div-on-click  
category: "asp.net"  
tags: ["jquery", "javascript"]  
reading_time: 1 minute  

---

# How to toggle next hidden div on click

I have the following setup. I want to [toggle](https://www.mindstick.com/forum/12682/jquery-toggle-if-statement) the expanded div when clicking the expander [link](https://www.mindstick.com/articles/23633/link-builder). I only want to [expand](https://www.mindstick.com/articles/13054/here-s-how-crm-can-help-you-expand-your-business) the div directly next to the link though. How can I do this?

```
<a class="expander" href="#"><?php echo get_the_title($post->ID); ?></a><div class="expanded">    content here</div> <a class="expander" href="#"><?php
echo get_the_title($post->ID); ?></a><div class="expanded">    content here</div> <a class="expander" href="#"><?php
echo get_the_title($post->ID); ?></a><div class="expanded">    content here</div>
```

**Here's my jquery:**

```
$('.expander').click(function() {    event.preventDefault();    $(this).siblings('expanded').toggle();});
```

## Replies

### Reply by Anonymous User

Use next instead. I think this should work:

```
$('.expander').click(function() {    $(this).next('.expanded').first().toggle();}); 
```


---

Original Source: https://www.mindstick.com/forum/12909/how-to-toggle-next-hidden-div-on-click

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
