caolan/forms — pull request #137 by pstadler (2014-07-23 08:35:09+00:00)
Title: Allow empty attribute values

I was running into an issue where I wanted to set an empty value for an `
` tag. This is basically the default behavior to define a placeholder for select fields.

```javascript
choices = {
'': 'Make a choice',
'choice1': 'Choice 1',
'choice2': 'Choice 2'
}
```

This generates the following markup:

```HTML

Make a choice

Choice 1

Choice 2

```

The problem is that browsers use the text between the option tag as a value if the corresponding attribute is missing ([docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#Attributes)). In the example above, the value is implicitly set to "Make a choice" instead of null.

This commit fixes the tag rendering to allow empty attributes:

```HTML

Make a choice

Choice 1

Choice 2

```