JSFiddle - React, Tailwind, and code Playground
HTML
<div id="group">
<input type="text" placeholder="foo" /><br>
<input type="text" placeholder="bar" />
</div>
<button id="toggleFields">swap fields</button>
JavaScript
inputFields = $("#group").find("input");
inputFields[1].disabled = true;
$("#toggleFields").on("click", function(){
inputFields.each(toggleElement);
});
function toggleElement(index, element) {
element.disabled = !element.disabled;
//idea from: http://stackoverflow.com/a/4702086/1063730
}