JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">

JavaScript

var mystring = '<div> bleh1 content </div> <div> bleh2 content </div>';

var length = $(mystring).filter('div').length;

$(mystring).filter('div').each(function(e) {
    // setTimeout is used to delay code from executing.
    // Here we multiply e (which is the index of the current 
    //   iteration) by 2000 milliseconds, so each iteration
    //   is delayed by an additional 2000ms
    (function(th) {
        setTimeout(function() {alert($(th).text());
                              if(!--length) {  alert('done'); }
                              }, e * 2000);
        
    }(this));
});