I have a div which is filled dynamically after calling an AJAX call by .html attribute
$("#gallery").html(imagesHtml);
insdie imagesHtml i ahve 2 buttons called "prebtn" and "nxtbtn" now I'm trying to bind these buttons with the following syntax in JQuery:
$("#gallery").bind('click', '#nxtbtn', function() {
alert('next');
});
and
$("#gallery").bind('click', '#prebtn', function() {
alert('previous');
});
but whener I click on one of the buttons both events get triggered and it shows allert for "next" and "previous"; howevr I have click just one of the buttons!
Please let me know if you need more clarification.
Thanks