Make sure elem.attribs exists

before calling hasOwnProperty on it
Add test
remove space before function arguments
Merge pull request #11 from Janpot/patch-1

Make sure elem.attribs exists