function myOnChange(s) { var o = s.options[s.selectedIndex]; var t = o.text; document.location = "whatever?setButtonTo="+t; }