tryTemplate imcomplete javascript function

for finishing:

http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_option_selected2
http://www.w3schools.com/jsref/coll_select_options.asp
http://stackoverflow.com/questions/21343216/javascript-loop-through-all-html-select-option