How can I use the selected combo box item as a variable for the use of javascript image calling?
HTML
<select id="fileType">
<option value=".jpg">.JPG</option>
<option value=".png">.PNG</option>
<option value=".gif">.GIF</option>
</select>
JavaScript
var selectedComb = document.getElementById("fileType");
var selectedFileType = selectedComb.options[selectedComb.selectedIndex];
var selectedType = selectedFileType.value;
document.write('<img src="example.com/images/pic + 'selectedType'"/>');
Now, obviously this doesn't work. How can I make it work? Its really just the document.write line that needs to be fixed.