This needs to check that the key *begins* with "data-":

```javascript
> 'foo-data-bar'.match('data-')
["data-"]
```

I suggest:

```javascript
var match = /^data-(.*)$/.exec(key);
if (match) {
  elem.data[match[1]] = elem.attribs[key];
}
```