I've been searching around for how to select a dynamically-created (by JQuery) element (in this case, div with class "date"), and keep coming across the .on('click') method. While this works, it seems to only select that div once the page (or containing div #date-container, whichever I have initially) is clicked.
Ideally, right when the .date divs load, I would like to perform some JQuery on them. Is this possible without clicking?
JQuery:
$("#date-container").on("click", ".date", function() {
$('.date').text( $('.date').text().replace('[', '') );
});
HTML:
<div id="date-container"></div>