JSFiddle - React, Tailwind, and code Playground

by Eric Howe

HTML

<div id="one">xyz</div>
<div id="two">abc</div>
<input id="reverse" type="button" value="Reverse" />

JavaScript

$('#reverse').click(function() {
    var $one = $('#one');
    var $two = $('#two');
    $one.attr('id', 'two');
    $two.attr('id', 'one');
});