Organismal development requires the precise coordination of genetic programs to regulate cell fate and function. MEF2 transcription factors (TFs) play essential roles in this process but how these broadly expressed factors contribute to the generation of specific cell types during development is poorly understood. Here we show that despite being expressed in virtually all mammalian tissues, in the retina MEF2D binds to retina-specific enhancers and controls photoreceptor cell development. MEF2D achieves specificity by cooperating with a retina-specific factor CRX, which recruits MEF2D away from canonical MEF2 binding sites and redirects it to retina-specific enhancers that lack the consensus MEF2-binding sequence. Once bound to retina-specific enhancers, MEF2D and CRX co-activate the expression of photoreceptor-specific genes that are critical for retinal function. These findings demonstrate that broadly expressed TFs acquire specific functions through competitive recruitment to enhancers by tissue-specific TFs and through selective activation of these enhancers to regulate tissue-specific genes.