suitelet code is executed on the server side. the...
# suitescript
s
suitelet code is executed on the server side. the page hasn't been rendered, no DOM or window to interact with. there are a number of ways to achieve what you want though, i think. You can write the client side code in a client script and attach it to the suitelet form prior to the response. checkout
N/ui/serverWidget.Form.clientScriptFileId
and/or
...clientScriptModulePath