JSFiddle - React, Tailwind, and code Playground
by kos0760
HTML
<script src="//code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!--
Bootstrap docs: https://getbootstrap.com/docs
-->
<div class="container">
<form>
<div class="row panels last-panel">
<div class="col-2">
<label for="staticEmail" class="col-form-label">Панель №<span>1</span></label>
</div>
<div class="col">
<input type="text" class="form-control" placeholder="Ширина">
</div>
<div class="col">
<input type="text" class="form-control" placeholder="Высота">
</div>
</div>
</form>
</div>
CSS
.row {
margin-top: 30px;
}
JavaScript
$('form').each(function (){
var ths = $(this);
var panels = $(this).find('.panels');
var last_panel = $(this).find('.last-panel');
$(ths).find('.last-panel input').focus(function(){
$(last_panel).clone().appendTo(last_panel.parent());
$(ths).find('.panels').each(function(i){
$(this).removeClass("last-panel");
$(ths).find('.panels:last').addClass("last-panel");
$(this).find('label span').html(i + 1);
});
})
});