I am trying to validate null input for dropdown selection, but the onchange event is triggered without any change of selection on dropdown list, when the window.onLoad() is instantiated.
It would be better if you can provide your snipped code for your problem. You can try to add the
target.addEventListener(type, listener);
target.addEventListener(type, listener, options);
target.addEventListener(type, listener, useCapture);
On the other hand, you might want to try:
event.preventDefault();
Also, you can learn more here: EventTarget.addEventListener() or Event.preventDefault()