Your error is that you expect entries[i] to have a vaule inside the clickevent.
$("#"+ entries[1] +"-choice-C").bind("click", function() {
$("#"+ entries[1] +"-lizard").show();
});
The value of entries[i] when you click will be undefined, because the value if i will be 2 (the same as the length of the array).
What you need is a closure to keep the value of i, and here is an example:
var items = ["a","b", "c"];
var displayItem = function (i) {
window.setTimeout(function () {
alert(items[i]);
}, 100);
}
for (var i = 0; i < items.length; i++) {
displayItem(i);
}
For the code that soves your problem, got to the feedle that @Ian commented.
clickevent occurs), the loop has completed...meaning thatindexrefers to the last item in the loop, soentries[index]inside the handlers won't refer to what you expect. My example captures the value ofindexby creating a new scope (callinghandleItem) so that all references toindexinside the handlers will be the specific point in the loop