I have the following in Drupal.behaviors:
$(context).find('#x').prepend('<div class="settings"></div>');
$(context).find('div.settings').click(
function () {
$('#p').show();
},
function () {
$('#p').hide();
}
);
The div gets prepended, but the click does nothing. If I just enter the jQuery('#p').show() in the console, it works fine.