Remove conditional that prevents attr from working on non-Element nodes. Fixes #7451.