I am using multiple-select.js, there when I set the value using setSelects method they are set the value and dynamically trigger the onchange function. But In my situation I want to disable this dynamically triggering. Also I can't able to modify the multiple-select.js because many one use this plugin in different module.
If I can detect is this onchange function is call from dynamically trigger or native dropdown change, my problem will solve. But don't use any global variable . Only we can use argument(may be we can use onchange="ddlchange(this)").
I am wrote a simple example like my problem
<script>
function check(ths)
{
//Here I want to know is it come from real change or manually trigger, without using any variable
alert("function called");
}
function trifun()
{
//I can't modify this line, because it is in external plugin
document.getElementById('ddl').onchange();
}
</script>
<button onclick="trifun();">Trigger</button>
<select id="ddl" onchange="check(this);">
<option value="1">Test</option>
<option value="2">Test</option>
<option value="3">Test</option>
<option value="4">Test</option>
<option value="5">Test</option>
</select>