Custom select: Get rid of hasAttribute. Fixes #5506. Thanks erikyuzwa.