I am trying to create this html block in javascript:
<label>
<input name="{{ $amenity->name }}" type="checkbox" class="minimal">
text
</label>
I have:
var checkBox = document.createElement("input");
var label_input = document.createElement("label");
label_input.innerHTML = value.name;
label_input.appendChild(checkBox);
But the result is
<label>
text
<input name="{{ $amenity->name }}" type="checkbox" class="minimal">
</label>
and I tried to add the checkbox first and then the text but no success.