[Javascript] <SELECT value=image???>

Scott Reynen scott at randomchaos.com
Mon Aug 21 13:29:57 CDT 2006


On Aug 21, 2006, at 12:38 PM, tedd wrote:

> Does anyone have any references, or code, where a SELECT tag in a  
> html doc can be used to show small images (i.e., thumbnails)?
>
> In other words, instead of having the SELECT tag show different  
> *text* options -- have it show *image* options instead?
>
> Something like this:
>
> <SELECT NAME="images">
> <OPTION VALUE="a"><img src="a.jpg" alt="" height="84" width="112"  
> border="0"><br/>
> <OPTION VALUE="b"><img src="b.jpg" alt="" height="84" width="112"  
> border="0"><br/>
> <OPTION VALUE="c"><img src="c.jpg" alt="" height="84" width="112"  
> border="0"><br/>
> </SELECT>
>
> Except it would work to show images.

SELECTs work to select (hence the name), and showing options is only  
one means to that end.  (Screen readers use different means.)  Do you  
want to use a SELECT to select which images to show in the document  
or do you want to put images within the SELECT itself?  The former is  
possible; the latter is not.  I think you're asking for the latter,  
but your word choice is a bit confusing.  There are dozens of drop- 
down menu systems, using either with JavaScript or CSS, which can be  
made to work like a SELECT and contain images.  I'd start here:

http://alistapart.com/articles/dropdowns/

and have the links update a hidden form input value.  I'd also  
provide a standard SELECT for people without JavaScript.

Peace,
Scott




More information about the Javascript mailing list