How to filter the DIVs called by AJAX with jQuery?


I use a simple jQuery code to filter DIVs with given class. It is based on the method given here, and working demo is here

    var links = $('.bound');
    var divs = $('div');{
       divs.filter('.' +;

This works when the DIVs are originally in the html code; but I call DIVs from an external file via simple jQuery ajax.

  type: 'POST',
  url: 'external.html',
  success: function(html){

How to mix these two simple jQuery codes to work together to filter DIVs provided by ajax?

here's an example:

Also have a look at the jquery live documentation. This will give you the abilty to bind events to selectors that aren't even present within the DOM (like objects you attach after an ajax call)

$('.bound').live('click', function(event) {
    $('div').hide().filter('.' +;