# \[JS\] Drop down menu and div targeting

**URL:** <https://forum.kirupa.com/t/js-drop-down-menu-and-div-targeting/239444>\
**Category:** web dev\
**Created:** [September 21, 2007, 7:06pm UTC](https://forum.kirupa.com/t/js-drop-down-menu-and-div-targeting/239444 "2007-09-21T19:06:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter71](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@Peter71](https://forum.kirupa.com/u/Peter71)\
**Post date:** [September 21, 2007, 7:06pm UTC](https://forum.kirupa.com/t/js-drop-down-menu-and-div-targeting/239444/1 "2007-09-21T19:06:10Z")

</div>

I use a script that I actually got from a user here, that allows me to hide and reveal a div when you click on a link. This has been very useful, and I was wondeing if there was a way to do this with a dropdown menu as well. So if I wanted to show infrmation based on a state, so to speak, is there a way that I could use JavaScript to reveal the “Alaska” content when i select Alaska from the drop down menu?

Thanks in advance, and here is the script that I have been using:

```auto

<a href="javascript:;" onclick="document.getElementById('mystate').style.display = (document.getElementById(mystate).style.display == 'none') ? 'block' : 'none'">
Click me to reveal my state information</a>

```
