There is a <div> in which the <input> and its <label> next to it:
<div class="form-item">
<input data-drupal-selector="edit-field-entity-product-category-target-id-verf-365-lp1ntlq5bca" type="radio" id="edit-field-entity-product-category-target-id-verf-365--Lp1nTLQ5bcA" name="field_entity_product_category_target_id_verf" value="365" class="input input--radio form-input form-radio">
<label for="edit-field-entity-product-category-target-id-verf-365--Lp1nTLQ5bcA" class="option">Headwear</label>
</div>
When I wrote this part of the code like this:
function () {
let formInput = $(".form-input");
let html = "<span>";
$.each(formInput, function() {
let $this = $(this);
if($this.is(":checked")) {
html += $this.val();
}
});
html += "</span>";
$(".product-list-wrapper .rows-wrapper .tags-container").html(html);
$(".rows-wrapper").show();
}
In this case, not Headwear gets into the tags-container container, but the value of the input itself, that is, 365, but Headwear is needed.