You can open the JavaScript Console and write a script that doesn’t belong to any field or element. Scripts written in the JavaScript Console can be used to test routines and debug code.
To use the JavaScript console:
On the Forms ribbon tab, in the JavaScript group, click Console