I have a div which completely created on the fly when the page is loaded and this div is visible to the user and in firebug but when i view the page source its not available.. the content within the div changes dynamically.
im trying to bind a click event to it so when someone clicks on that div to alert a message..
i have go through almost all the suggestions but none of them work
my dynamic div
<div class="mootoo drive form2">Hello this a mootoo test</div>
Tested JQuery functions
$(document).on('click', ".mootoo", function() {
alert("clicked");
});
$('.mootoo').on('click',function() {
alert("clicked");
});
$('.mootoo').live('click',function() {
alert("clicked");
});
Can someone please tell me what am i doing wrong?
actually i cant find the JQ code where it generates the div But im having the exact same problem with this
http://jsfiddle.net/g1sqrxg6/3/
if you see when i click it doesnt alert "chosen-choices" is the dynamically created class..
in that case i when a user selects and or clicks on that div or box i need to put an alert