I dynamically add text to a list like such:
var list = document.getElementById('list');
var entry = document.createElement('li');
entry.appendChild(document.createTextNode('text'));
list.appendChild(entry);
I want to modify this so that for the list item, when you hover over the item it will show a tooltip with some text. I found example online:
<div class="tooltip">Hover over me
<span class="tooltiptext">Tooltip text</span>
</div>
But I don't know how to combine it with the li item