Javascript code is not working

There wouldn’t be in this case as the functions are not running because there is no code in the JavaScript to tell them to run.

Once the extra JavaScript is added to detect whatever event is supposed to be triggering the show and hide of the tooltip then the functions that are there should work.

There is insufficient information provided to determine what event to check for.