I am quite new to javascript and jquery so this might be a really simple problem. Please don't mind.
I am appending new link(a) elements in division with id = "whatever" by
$("#whatever").append(jQuery('<a>').attr('href', 'url').text('blah'));
And calling a function
$(function () {
$('#whatever a').tagcloud();
});
on every link element inside that particular div. But this function is being called only on old elements and not on the ones that I just dynamically added. I tried doing this:
$(document).on("change", '#whatever', function () {
$("whatever a").tagcloud();
});
But its still not working.
var $link = $('<a>').attr('href', 'url').text('blah');
$("#whatever").append($link);
$link.tagcloud();
$(document).on("change" will never fire.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With