chrisdavies/tlite

tooltips for elements created by javascript?

jedierikb opened this issue · 1 comments

Can I add tooltips to elements I've created and added via javascript? Could you provide an example?

Yup. It uses event delegation, so dynamic elements should work. You can try it out by throwing this code into an HTML page where you've got tlite's JS and CSS included:

tlite(function (el) { return el.classList.contains('foo'); });

document.body.innerHTML = '<button class="foo" title="Hi">Hover Here</button>';