diff --git a/src/HtmlBuilder.php b/src/HtmlBuilder.php
index 1e9f797..dde125e 100755
--- a/src/HtmlBuilder.php
+++ b/src/HtmlBuilder.php
@@ -358,9 +358,6 @@ class HtmlBuilder {
{
$html = array();
- // For numeric keys we will assume that the key and the value are the same
- // as this will convert HTML attributes such as "required" to a correct
- // form like required="required" instead of using incorrect numerics.
foreach ((array) $attributes as $key => $value)
{
$element = $this->attributeElement($key, $value);
@@ -380,6 +377,9 @@ class HtmlBuilder {
*/
protected function attributeElement($key, $value)
{
+ // For numeric keys we will assume that the key and the value are the same
+ // as this will convert HTML attributes such as "required" to a correct
+ // form like required="required" instead of using incorrect numerics.
if (is_numeric($key)) $key = $value;
if ( ! is_null($value)) return $key.'="'.e($value).'"';