Title: Javascript Category drop down help
Last modified: August 24, 2016

---

# Javascript Category drop down help

 *  [Spnkmyr](https://wordpress.org/support/users/spnkmyr/)
 * (@spnkmyr)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/javascript-category-drop-down-help/)
 * Hey, this may not be the best place for this, but maybe someone can help me out
   quick. I am using the following for a drop down category menu in my archive page.
   All I want to do is make the width 100% in css. Is there a way to add a css class
   to this at all? Or, any way to change the width in pixes of the box? As it stands,
   it’s as wide as it needs to be. Thanks!
 *     ```
       <script type="text/javascript"><!--
           var dropdown = document.getElementById("cat");
           function onCatChange() {
       		if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
       			location.href = "<?php echo get_option('home');
       ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
       		}
           }
           dropdown.onchange = onCatChange;
       --></script>
       ```
   

The topic ‘Javascript Category drop down help’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Spnkmyr](https://wordpress.org/support/users/spnkmyr/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/javascript-category-drop-down-help/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
