var paths = document .querySelectorAll('path");
var tooltip = document.getElementById('tooltip');
paths. forEach(function (path) {
path.addEventListener('mouseover', function(e) {
tooltip.style.visibility = 'visible'
tooltip.style.left = e.pageX + 20+ 'px';
tooltip.style.top = e.pageY + 20 + 'px';
tooltip. innerHTML = path.getAttribute('title");
});
path. addEventListener ('mouseout', function) {
tooltip.style.visibility = 'hidden';
});
});
top of page
bottom of page