Closing a dashboard popup with code

Hi

I have created a dashboard.

When a user selects some data and confirms it, i would like to close the dashboard window by code. Probably by JS.

Is there a way to do this?

thank you