This doesn't seem like the correct behaviour. Here's what jQuery does:

```javascript
> $('<input type=text data-foo=1 data-bar=2>').data()
{foo: 1, bar: 2}
```

Here's what (I think) the code below does:

```javascript
> $('<input type=text data-foo=1 data-bar=2>').data()
{type: 'text', 'data-foo': '1', 'data-bar': '2'}
```