Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<div class="homepagetabcontent" id="tabcontent0">0</div>
<div class="homepagetabcontent" id="tabcontent1">1</div>
</body>
</html>
 
function detatchFromDOM(els) {
  for (i = 0; i < els.length; ++i) {
     els[i].parentNode && els[i].parentNode.removeChild(els[i]);
  }
  return els;
}
function attachToDOMById(id, els) {
  detatchFromDOM(els);
  var filter = Array.prototype.filter;
  var el = filter.call(els, function(el) {
    return el.id === id;
  });
  el[0] && document.body.appendChild(el[0]);
}
var tabContents = document.querySelectorAll('.homepagetabcontent');
detatchFromDOM(tabContents);
attachToDOMById('tabcontent0', tabContents);
setTimeout(function() {
  attachToDOMById('tabcontent1', tabContents);
}, 4000);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers