Как оставлять значение в поле input
ниже указанным кодом выводится значение отмеченого чекбокса построчно, а так же пустое поле input. Когда его заполнить и после выбрать следующий чекбокс значение в ранее заполненом input обнуляется. Как сделать так чтоб значение оставалось?
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="sum_value" style="display: table;">
<div id="aaa" style="display: table-cell;">
<label>
<input type="checkbox" value="aaa 10" id="aaa"><span>10</span>
</label>
</div>
<div id="aaa_All">
<div id="aaa_B" style="display: table-cell;">
<label>
<input type="checkbox" value="aaa_B 1" id="aaa_B">B<span>1</span>
</label>
</div>
<div style="display: table-cell;">
<label>
<input type="checkbox" value="aaa_M 2" id="aaa_M">M<span>2</span>
</label>
</div>
<div style="display: table-cell;">
<label>
<input type="checkbox" value="aaa_S 3" id="aaa_S">S<span>3</span>
</label>
</div>
<div id="aaa_B_p_r" style="display: table-cell;">
<label>
<input type="checkbox" value="aaa_B_r 4"
id="aaa_B_r"><span>4</span>
</label>
</div>
<div id="aaa_B_p_w" style="display: table-cell;">
<label>
<input type="checkbox" value="aaa_B_w 5"
id="aaa_B_w"><span>5</span>
</label>
</div>
</div>
</div>
<div class="column_2">
<div class="options_sum" id="options_sum">sum: <span></span></div>
<div class="options_value" id="options_value">seg: <p id="options_value" class="options_value"></p>
</div>
</div>
<script>$(document).ready(function () {
$('.sum_value input').click(function () {
$('#options_value').html('');
$('input:checkbox:checked').each(function () {
$('#options_value').append($(this).val() + '<input type="text" style="background-color: rgb(240, 54, 54);"><br>');
});
});
});</script>