use properties rather than DOM attributes

Fixes #1.
Merge remote-tracking branch 'upstream/master'

Conflicts:
	index.js
Lowercase element's type attribute

Also remove second toLowerCase() on element's name