I am trying to accomplish the following....
- Create a dropdown menu that is a list of last names
- When a last name is selected, display all of the images with that last name
Attempt...
<script>
function displayAllImages() {
var smith = ["text instead of Smith pictures","text instead of Smith pictures2"];
var jones = ["text instead of Jones pictures"];
for (i=0;i<2;i++) {
document.write("<li><p>" + smith[i] + "<p/></li>");
}
};
</script>
<select>
<option value="smith">Smith</option>
<option value="jones">Jones</option>
</select>
<div>
<ul>
<script>displayAllImages();</script>
</ul>
</div>
What I need help with is relaying the dropdown selection to the the javascript function so I can switch between arrays.
Thank you!