I am generating html that displays records at a field level (i.e. name, dob, favorite programming language, etc.) and am creating html tooltips for each field.
I know that headers could be used but I am displaying different types of records and would like to allow the user a quick tooltip to show them what they are looking at.
This works fine for a small number of records, but when I have thousands of records, the html is largely composed of the same tooltip data over and over.
I'd like to somehow pre-create these tooltips in css or in javascript to only have to render the actual tooltip content once on the page but reusable by specifying a class (or similar).
For example, given:
<div class="field tooltip">bar<span class="tooltiptext">This
field represents what foo needs</span></div>
I'd like to use something like this instead:
<div class="field tooltip tt-bar">bar</div>
where tt-bar
refers to a tooltip created using css and/or javascript.
Any ideas would be very appreciated.
Note: I am not using JQuery or any other libs and I'd like to keep it that way.