These both work, but you need to trigger the functions somehow.
Are you following some kind of tutorial? I really suggest starting with some sort of instruction of some sort. Otherwise you’re just fighting an uphill battle you’re probably not going to win.
For example:
There are plenty of other introductory courses out there as well.
I am also trying to improve my JavaScript skills and don’t totally understand your code. I have a question for you (sometimes if you can explain to someone else what your code is supposed to do, it helps you find the problem): How are the functions supposed to be triggered?
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.