I'm trying to append to a non DOM element (Pagiantion added for a slideshow).
My code is:
$("#slides2 .slidesjs-pagination-item a").on("click", function (event) {
alert('append');
});
which does not give me an alert. As on
is replacing live
, I'm wondering why this doesn't work?
UPDATE The comment by adeno helped, and my code is now :
$(document).on("ready", "#slides2 .slidesjs-pagination-item a", function (event) {
$("#slides2 .slidesjs-pagination-item a").prepend("Image");
$("#slides2 .slidesjs-pagination-item a").append(" of 30");
});
which doesn't work, how do I attach an event that recgonises when it is the element is loaded?