<!doctype html>
<p>
Both lines below should look the same:
</p>
<div id="target" style="display: flex"></div>
<div style="display: flex">A B</div>
<script>
target.appendChild(document.createTextNode("A"));
target.appendChild(document.createTextNode(" "));
target.appendChild(document.createTextNode("B"));
</script>