Best way to get document IDs for CustomJS callbacks?

I’ve got some stuff that takes a while and wanted to run a ‘wait’ cursor through a JS callback. What is the best way to accomplish this? So far my attempts to get the bk-plotdiv ID and such have failed with callbacks with getElementsByClassName() and other methods.