Same as jQuery's `attr` method did. But due undesired side effects (the ones you mentioned) it was changed and now `attr` always operates of HTML node attributes and `prop` operates on JS properties.