Waiting for click() event to finish [duplicate]

document.getElementById('statusTab').click();

Got the above code and would like to wait for the click() to finish before proceeding with the next code.

Right now I’ve got a window.timeout() after above – but I don’t think that’s efficient or the best way.

This is plain javascript – no jquery.