How can I simple add image to selectbox? I found few jQuery plugins, but they very large. I need something simple. Just add image to option.开发者_StackOverflow社区
Thanks.
There's no cross-browser compatible way of doing it purely with HTML, the specs don't allow an image in the OPTION content. I'm pretty certain only text nodes are allowed.
Using javascript and an unordered list (which can contain non-text nodes), or similar, to mimic a select box is the best (and perhaps only) real solution to my knowledge.
精彩评论