function mychosen(){
$(".chosen-select").chosen();
mytooltip();
}
function mytooltip(){
$(".active-result").each(function () {
$(this).attr("data-toggle","tooltip");
});
}
$(document).ready(function () {
mychosen();
});
.chosen() adds
<ul><li>
items to the html. The li elements have a class "active-result". However, when I try to change them it doesn't work because my second function gets called before chosen has completed, so that piece of code doesn't work. How can I call my second function after chosen finishes?
So, the chosen plugin only adds the html after clicking the button. Hence why my code wasn't working. For anyone having similar issue in the future, this is what to do:
Then in the function: