[jQuery] Selected Option Value

[jQuery] Selected Option Value

<div>AHA!  I wish I knew this 4 hours ago!</div>
<div>

function whatisit() {
  alert($("select option:selected").val());
}


<body>
<select onchange="whatisit()">
<option value="2">test</option>
<option value="3">blah</option>
<option value="4">foo</option>
</select>




</div>
<div>Why didn't anyone tell me this worked?  Ugh.</div>
<div> </div>
<div>Glen</div>
<div> </div>