JSFiddle - React, Tailwind, and code Playground

by Sledgehammer

HTML

<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<div id="tabs" class="tabs-bottom">
    <ul>
        <li><a href="#tabs-1">RIGHT TAB 1</a>
        </li>
        <li><a href="#tabs-2">RIGHT TAB 2</a>
        </li>
    </ul>
    <div id="tabs-1">
        <ul>
  <li><a href="deny.html">FOOBAR</a></li>
</ul>
    <span style="cursor:pointer" onclick="$.addTab();">PRESS HERE TO ADD TAB</span>
    </div>
    <div id="tabs-2">
        <ul>
  <li><a href="deny.html">FOOBAR</a></li>
</ul>
    <span style="cursor:pointer" onclick="$.addTab();">PRESS HERE TO ADD TAB</span>
    </div>
    <div class="tabs-spacer" style="height:0px"></div>
</div>

JavaScript

$(function () {
          var tabs = $("#tabs").tabs({
              beforeLoad: function (event, ui) {
                  ui.jqXHR.error(function () {
                      ui.panel.html(
                          "Couldn't load this tab. We'll try to fix this as soon as possible. " +
                          "If this wouldn't be a demo.");
                  });
              }
          });
          // move the nav to the bottom
          $(".tabs-bottom .ui-tabs-nav").appendTo(".tabs-bottom");

          $.addTab = function (nazwa, url, ctx) {
              tabs.find(".ui-tabs-nav").append('<li><a href="http://fiddle.jshell.net/">New Tab</a> <span class="ui-icon ui-icon-close">Remove Tab</span></li>');

              tabs.tabs("refresh");
          }

      });