 <p>I recommend you use jQuery, this works:</p> <pre><code>$("#city").change(function (e) { e.preventDefault; var city = $("#city option:selected").text(); if ( city == "Berlin" ) { alert("You are in Berlin"); } }); </code></pre>