I have a select list of genders.
Code:
For those wanting to display an icon, and accepting a "black and white" solution, one possibility is using character entities:
By extension, your icons can be stored in a custom font. Here's an example using the font FontAwesome: https://jsfiddle.net/14606fv9/2/ https://jsfiddle.net/14606fv9/2/
One benefit is that it doesn't require any Javascript. However, pay attention that loading the full font doesn't slow down the loading of your page.
Nota bene: The solution of using a background image doesn't seem working anymore in Firefox (at least in version 57 "Quantum"):