cheeriojs/cheerio — pull request #570 by raoulmillais (2014-10-01 11:31:20+00:00)
Title: attr() should return undefined or name for booleans

jquery behaviour is to return the attrribute name when present

$('').attr('autofocus') => "autofocus"
$('').attr('autofocus') => undefined

this PR changes the attr/removeAttr behavoiur to match.