I’ve searched, and found many good css tooltip scripts, but can’t find the one that I need: A css tooltip-type script that occurs onClick, with a hide button.
I’ve got a list of more than 100 names in a roster, and want to be able to click on any of them, popping up the tooltip (with all their info) in the center of the page.
I’m still new at all this. Can anyone point me in the right direction?
Make a div with a unique ID in your HTML code, with everything you want to show in your tooltip. Then apply the display:none CSS.
Then for your target, use onclick attribute to trigger your javascript to use the getElementById() function and apply the display:block CSS.
For the close button, use another target span or div inside of the parent div of your tooltip with another onclick attribute to apply display:none to the parent div again.