Jarosław Rewers Jarosław Rewers - 2 months ago 5x
jQuery Question

What event to handle choose option from <select>?

I have an select with options which are loaded by ajax. After that user chooses option and additional data is pulled from ajax.
Of course at least one these options is selected as soon as select is filled with options so when I listen for change of this option:

$('article select.fetchedPosts').on('change', function () {
//do stuff and things

and user wants to fetch data for first (by default already selected) option the event is not firing because nothing has changed...
So is there any event in JS which would fire everytime user chose something from select, using keyboard or mouse?


You can do default instead of Option 1 Which option as "Select Option", and the user will have to replace the selection.

  <option>select option...</option>