JSFiddle - React, Tailwind, and code Playground

by Brett Miley

HTML

<a rel="1234">one</a>
<a rel="5678">two</a>
<a rel="2222">three</a>

<div id="1234">Content one</div>
<div id="5678">Content two</div>
<div id="2222">Content three</div>

CSS

a {
  padding: 8px;
  background: red;
  display: block;
}

JavaScript

$('a').each(function () {
  
  var tabno = $(this).attr('rel');
  $('#' + tabno).insertAfter( this ); 
  
});