Fixed for window if getAttribute doesn't exist