You can imitate this with HTML and CSS.
If you really want dynamically applied tooltips to work, this solution (not so productive and architectural) can allow you to use tooltips using a browser without resorting to using JS. I can imagine situations where it would be better than JS.
If you have a fixed subset of the value of the title attribute, you can create additional elements on the server side and let the browser read the title from another element above the original using CSS.
Example:
div{ position: relative; } div > span{ display: none; } .pick-tooltip-1 > .tooltip-1, .pick-tooltip-2 > .tooltip-2{ display: block; position: absolute; width: 100%; height: 100%; top: 0; left: 0; }
<div class="pick-tooltip-1"> Hover to see first tooltip <span class="tooltip-1" title="Tooltip 1"></span> <span class="tooltip-2" title="Tooltip 2"></span> </div> <div class="pick-tooltip-2"> Hover to see second tooltip <span class="tooltip-1" title="Tooltip 1"></span> <span class="tooltip-2" title="Tooltip 2"></span> </div>
Note. This is not recommended for large-scale applications due to unnecessary HTML, possible repetitions of the content, and the fact that your additional elements for the tooltip will steal mouse events (text selection, etc.).
Alph.Dev 23 Oct '17 at 12:20 2017-10-23 12:20
source share