Simplest JavaScript tooltips
$ npm install --save tooltipr
Require tooltip after installation
var tooltipr = require("tooltipr");
Add data-tooltip = "hello world"
to your element
<div class="elem" data-tooltip="hello world">Tooltip</div>
Create tooltip
var tooltip = tooltipr();
var elem = document.querySelector('.elem');
elem.onmouseover = function() {
tooltip.create();
}
Remove tooltip
elem.onmouseout = function() {
tooltip.remove();
}
Add styles
.tooltip {
position: fixed;
}
MIT