Fixed an issue with parentNode being accessed in attr() on disconnected DOM elements.