It looks like placing the click event directly on the button is causing the problem. For some reason it can't find the function. Not sure why...
If you attach the event handler in the javascript, it does work however.
See it here: http://jsfiddle.net/WfBRr/7/
<button id="display-text" type="button">Display text of all options</button>
document.getElementById('display-text').onclick = function () {
var x = document.getElementById("mySelect");
var txt = "All options: ";
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "\n" + x.options[i].value;
}
alert(txt);
}