Jquery On Click method not working for newly added Div
I wrote a code that on a button click adds a new tweet (div) to the div list. See the abbreviated code below. Now, even if the new div has all the same classes as the other divs. It doesn't execute when clicked.
How can I get jquery click method to work for newly added divs?
$('.buttonClass').on('click', function() {
....
$newTweet.insertAfter('button');
});
$('.douglascalhoun').on('click', function() {
$("div").slideToggle();
$("div.douglascalhoun").slideDown();
});
+3
source to share
3 answers