diff --git a/inc/Form/DropdownElement.php b/inc/Form/DropdownElement.php
index 5b77566ab39f2f6ae22cadd3f69878516b40589a..6a2147d0aaea9bcf25b1dee3a9e3e5db04877a61 100644
--- a/inc/Form/DropdownElement.php
+++ b/inc/Form/DropdownElement.php
@@ -113,8 +113,9 @@ class DropdownElement extends InputElement {
         $html = '<select ' . buildAttributes($this->attrs()) . '>';
         foreach($this->options as $key => $val) {
             $selected = ($key == $this->value) ? ' selected="selected"' : '';
+            $attrs = '';
             if (is_array($val['attrs'])) {
-                array_walk($val['attrs'],function (&$aval, $akey){$aval = hsc($akey)."='".hsc($aval)."'";});
+                array_walk($val['attrs'],function (&$aval, $akey){$aval = hsc($akey).'="'.hsc($aval).'"';});
                 $attrs = join(' ', $val['attrs']);
             }
             $html .= '<option' . $selected . ' value="' . hsc($key) . '" '.$attrs.'>' . hsc($val['label']) . '</option>';