Let's say I have this selectbox :
<select id="my-select">
<option value="1">text_generated_dynamically</option>
<option value="2">text_generated_dynamically</option>
</select>
As you can see, the text of each option is generated dynamically by another function.
I'm using JS onchange event on the selectbox to launch a function and it works fine.
For example :
document.getElementById("my-select").onchange = function(){
alert(document.getElementById("my-select").value)
};
But sometimes, the dynamically generated options return the same text and the onchange event doesn't detect the change anymore since it's the same text value.
How can I listen to the VALUE instead of TEXT so the event knows there is a change even if the text is the same on both options ?