javascript innerhtml return value

Vasabi

New Member
I am having trouble to understand this.I have this bit code:\[code\]document.getElementById("widget-container-1").innerHTML="<div class='title'>Select town: "+ "<select id='drop'>"+ "<option name='Auckland' value='http://stackoverflow.com/questions/15716038/Auckland'>Auckland</option>"+ "<option name='Christchurch' value='http://stackoverflow.com/questions/15716038/Christchurch'>Christchurch</option>"+ "<option name='Dunedin' value='http://stackoverflow.com/questions/15716038/Dunedin'>Dunedin</option>"+ "<option>Hamilton</option>"+ "<option>Tauranga</option>"+ "<option>Wellington</option>"+ "</select><br />"+ "<button id='update' value='http://stackoverflow.com/questions/15716038/update'>update</button></div>"+ "<div class='monitor'>Sort by"+ "<input id='radio' name='input' type='radio' value='http://stackoverflow.com/questions/15716038/0' >town"+ "<input id='radio' name='input' type='radio' value='http://stackoverflow.com/questions/15716038/1' >max temp"+ "<div class='section'>test</div></div>"; select = document.getElementById("drop"); select.onchange = function(){ /*here is where I need place the code to pass data to another function*/ /*alert(this.options[this.selectedIndex].text);*/ };\[/code\]the alert works fine and return the data I want, but I want to get the data and perform another function:\[code\]var _checkNewTown = function(ntown){ /*here goes the codes for this function*/}\[/code\]If anyone could help me will be very appreciatted.
 
Back
Top