JSFiddle - React, Tailwind, and code Playground
by mischa
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
</body>
</html>
JavaScript
var theQueue = $({});
var $iframe1 = $('<iframe />');
$iframe1.attr("id", "test1");
var $iframe2 = $('<iframe />');
$iframe2.attr("id", "test2");
var elements = [$iframe1, $iframe2];
for (var i = 0; i < elements.length; i++) {
theQueue.queue(function() {
if (i == 0) elements[i].appendTo($("body"));
alert("crazy stuff");
if (i == 0) elements[i].remove();
$(this).dequeue();
});
}