I have created a demo, passing value with spaces around, defined two elements (p tag) in the HTML file, one with flex property and another without. An element with flex property showing the value without space in the HTML file and another one is simply displaying the actual value including space.
How to display actual value coming from JS file in the element with flex property?
UPDATE: I want to understand why is the flex property removing the space from the value?
var value = " is ";
document.getElementById('value').innerHTML = value;
document.getElementById('value1').innerHTML = value;
.flex{
display: flex;
}
<p class="flex">
<span>This</span>
<span id='value'>value</span>
<span>hello</span>
</p>
<p>
<span>This</span>
<span id='value1'>value</span>
<span>hello</span>
</p>