write labels for <option> tags based on selectedIndex using JavaScript
问题 This next question works in conjunction with the question I posted at loading text into textarea based on drop down selection That has been solved and I have templates posting to text boxes based on drop down selection using: var showLeftTemplates = function(sel) { var locations = [ "template 1", "template 2", "template 3", "template 4", "template 5", ]; var srcLocation = locations[sel.selectedIndex]; if (srcLocation != undefined && srcLocation != "") { document.getElementById('LeftTemplates'