How to get a handle of widget using open exterla url javascript

Hi, I have a fairly complicated model that has a dynamic panel with lots of states, so I want to use the open external url to write some javascript code to do the work but I don’t know how to get a handle of the widget…

Can someone help?