JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//cdn.ckeditor.com/4.5.4/standard/ckeditor.js"></script>
<div class="row hide_mail_id_domain">
<div class="col-sm-12">
<table class="table">
<thead>
<tr>
<th>Option</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<textarea class="ckeditor" required="" name="question_option[]"></textarea>
</td>
<td></td>
</tr>
</tbody>
</table>
<a href="javascript:void(0)" class="btn btn-success add_more right" style="float: right;">Add More</a>
</div>
</div>
JavaScript
var REMOVE = '';
$(document).ready(function () {
$('.add_more').click(function () {
var tr_object = $('tbody').find('tr:first').clone();
$(tr_object).find('input').val('');
$(tr_object).find('td:last').html('<a href="javascript:void(0)" class="btn btn-danger remove_more">Remove</a>');
$('tbody').append(tr_object);
});
$(document).on('click', '.remove_more', function () {
var id = $(this).closest('tr').find('.id').val();
if (id != '') {
if (REMOVE != '') {
REMOVE = REMOVE + ',' + id;
} else {
REMOVE = id;
}
$('#id').val(REMOVE);
}
$(this).closest('tr').remove();
});
});