basically I have a simple SELECT input in my react app, where I want the options to contain both the text of some kind and a little image. I was wondering if that's possible. I'm fetching an external API that contains the names and images of some grandmaster chess players that I have to display in a selector input with options corresponding to the name and images of those players.
This is my selector code so far :
<select defaultValue={"Default"} onFocus={onFocus} onBlur={onBlur} style={style}>
<option value="Default" disabled hidden>Choose your character</option>
{state.map((data, key)=>{
return (
<option key={key}>{data.name}</option>
)
})}
</select>
"state" is the state which holds the array of objects that I get from the API. This is the output I get from this code :
And I just want to display images next to the player names, I'd appreciate the help!