make child categories dropdown
<p>i want to make dropdown for child categories, i have this code but it's not working ... </p>

<pre><code>       &lt;select name="event-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'&gt;
&lt;option value=""&gt;&lt;?php echo attribute_escape(__('Select Event')); ?&gt;&lt;/option&gt;
&lt;?php
$categories= get_categories('child_of=3');
foreach ($categories as $cat) {
$option = '&lt;option value="/category/archive/'.$cat-&gt;category_nicename.'"&gt;';
$option .= $cat-&gt;cat_name;
$option .= ' ('.$cat-&gt;category_count.')';
$option .= '&lt;/option&gt;';
echo $option;
}
?&gt;
&lt;/select&gt;
</code></pre>