I have the following HTML containing a drop down list (single selection)
When the HTML page is rendered,
Q1: But, in case I re-select
Flowers again, the
onchange event is not triggered. I understand it is because nothing was ‘changed’ in the drop-down list. Is there a way a function is triggered even when no change to the already selected value in drop-down is done?
Q2: How to extract the value of the element which has just been selected (even if nothing new was selected – that is, user clicked on the drop down, and simply clicked somewhere else).
I have already tried the
onblur but that requires that the user clicks somewhere else on the document so that the drop-down loses focus. Any help would be really appreciated.
[I have edited out the HTML headers and other script inclusions in the code snippet provided for brevity.]