I'm using JQuery UI's tooltips for a page using dynamic elements. It works perfectly on a single element, however when I attempt to add multiple tooltips the last tooltip defined seems to overwrite the existing items.
e.g.
$("body").tooltip({
selector: ".testItem1",
items: ".testItem1",
content: "1"
});
$("body").tooltip({
selector: ".testItem2",
items: ".testItem2",
content: "2"
});
In this case the second tooltip seems to overwrite the first.
Example (only the second items tooltip will work): https://jsfiddle.net/wce547w7/
Is there an alternative way to add tooltips to dynamic elements? Or can I use a property of some type to allow additional tooltips?
Edit: The dynamic elements are added outside of my control, so I cannot add the tooltip at the same time as creating the element.