This is the code for Chapter 8, Figure 11 from D3.js in Action that creates an image gallery with a zoom-to-image select input. This example uses D3 not only to create the image gallery made up of img elements but also the option elements that make the select input function.
https://d3js.org/colorbrewer.v1.min.js
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js