The button I created with some bootstrap attributes is not working properly on the first click. To resolve this, I initially called the function in onload and then again on the button click. However, I am now unable to do so and am seeking alternative solutions. Is there another way to solve this issue?
To view my code, please visit: https://jsfiddle.net/a22177861/x381z0h6/6/
Here is an excerpt of my HTML:
<button type="button" class="btn btn-warning" onclick="PopOver(this,'Hi','Thank','You');">ClickMe!</button>
And here is a snippet of my JS:
function PopOver(myObj, mgr, Adate, Vdate) {
$(function () {
myObj.setAttribute("data-container", "body");
// Additional setAttribute calls
$("[data-toggle='popover']").popover(); // Call popover()
});
}
Your assistance would be greatly appreciated!