Select Element onChange URL Redirect

answer to https://stackoverflow.com/questions/7562095/redirect-on-select-option-in-select-box. code salvaged via wayback machine: http://web.archive.org/web/20130722234047/http://jsfiddle.net:80/davidThomas/raqRG/1/

HTML

<select id="redirectSelect">
    <option value="">Please select</option>
    <option value="https://jsfiddle.net/user/jalbertbowdenii/">My JS Fiddles</option>
    <option value="https://jsfiddle.net/user/jalbertbowdenii/">My JS Fiddle Profile</option>
</select>

<p>
This fiddle is an answer to this Stack Overflow question: <a href="https://stackoverflow.com/questions/7562095/redirect-on-select-option-in-select-box">Redirect on Select Option in Select Box</a>.</p>
<p><a href="http://web.archive.org/web/20130722234047/http://jsfiddle.net:80/davidThomas/raqRG/1/">Original JS Fiddle</a> to the question; code salvaged via <a href="waybackmachine.org">Wayback Machine</a>.</p>

JavaScript

function redirect(goto){
    //var conf = confirm("Are you sure you want to go elswhere?");
    if (conf && goto != '') {
        window.location = goto;
    }
}

var selectEl = document.getElementById('redirectSelect');

selectEl.onchange = function(){
    var goto = this.value;
    redirect(goto);
    
};