As stated in title. Im trying to create a tooltip which will have some buttons inside. The problems is with the onclick function, which is somehow not working. This is the actual code I have.
$('#button_nowtime').popover({
trigger: 'click',
html: 'true',
title: "<b>Čas</b>",
content:
function() {
var returnstring="",button;
for(var i=0; i<files.length; i++){
button = document.createElement("a");
button.innerText = fileNametoButtonTime(files[i]);
button.onclick = (function() {
var currentID = i;
return function() {
alert("asd"); currentTimeIndex=currentID; setNowTimeButton(); drawImage(); $('#button_nowtime').popover('hide');
}
})();
button.href="#";
returnstring+=button.outerHTML;
returnstring+=" | ";
}
return returnstring;
}
});
The buttons appear in the tooltip but not react to the onclick function.
$(document).on('click', '.popover a', function(){}