@rohitpateldgm
What version of BAS are you using?
What OS are you using?
Does this problem only occur with one project or with others too?
Please attach the project you are having the problem with to this thread or in a private message on the forum.
@yourfriendkarol
This code contains an event handler. It should be added to the page before it is downloaded (preferably). Use "Browser -> execute every time the page loads". From "Tools -> execute the code" access to the root object "windows" is not. From this error there is - no "windows.document"