private static function buildAttribBoolVal($key, $value = true)
    {
        if ($key == 'autocomplete') {
            $value = $value ? 'on' : 'off';
        } elseif ($key == 'spellcheck') {
            $value = $value ? 'true' : 'false';
        } elseif ($key == 'translate') {
            $value = $value ? 'yes' : 'no';
        } elseif ($value) {
            // even if not a recognized boolean attribute
            $value = $key;
        } else {
            $value = null;
        }
        return $value;
    }