How can I design text with "span" using .insertAdjacentHTML in Javascript?
<p>This is what I think is has to look like:</p>

<pre><code>    toggleText.insertAdjacentHTML('beforeBegin', '&lt;span style="color:white"&gt;');
    toggleText.insertAdjacentHTML('beforeBegin', partvalue[partvalue.length-1]);
    toggleText.insertAdjacentHTML('beforeBegin', '&lt;/span&gt;');
</code></pre>

<p>But when I execute the function, I get this in HTML:</p>

<pre><code>&lt;span style="color:white"&gt;&lt;/span&gt;
"Text from partvalue.length-1"
</code></pre>

<p>This is what I would like to use, but I know it is not working like this. What can I do?:</p>

<pre><code>    toggleText.insertAdjacentHTML('beforeBegin', '&lt;span style="color:white"&gt;'partvalue[partvalue.length-1]'&lt;/span&gt;');
</code></pre>