javascript – Cannot click the OK button on window.alert

I have a HTML select element where I have a function call for the onchange event. For a particular condition, I am showing a window.alert() form that function but I cannot click the OK button in the alert dialog. In the background, I can see that the select options are expanded.

The only way I can make it go away is by using the escape button. When I debug the code I can click on the button.

So far I tried calling select.blur() and window.blur() before I call the window.alert() but not luck.