<select onSelect>

by ecmanaut

HTML

<a href="http://stackoverflow.com/questions/647282/is-there-an-onselect-event-or-equivalent-for-html-select">Can select boxes trigger js for all selections, including the current one?</a><br>
<select>
  <option>A</option>
  <option>B</option>
  <option>C</option>
</select>

JavaScript

$('select').on(
  { "focus": function() {
      //console.log('clicked!', this, this.value);
      this.selectedIndex = -1;
    }
  , "change": function() {
      choice = $(this).val();
      //console.log('changed!', this, choice);
      this.blur();
      setTimeout(function() { alert('Chose '+ choice); }, 0);
    }
  });