How to insert HTML tags in JavaScript array?
<p>I'm trying to insert an HTML link into a variable array with multiple strings, but the advice I've seen in other posts hasn't worked for me.</p>

<p>So, I define within a <code>&lt;script&gt;</code> tag a variable with 4 text strings like this: </p>

<pre><code>&lt;script&gt;
var btnTxt = ["blah blah blah", "blah-blah-blah", "blah blah", "blah"];
&lt;/script&gt;
</code></pre>

<p>When someone clicks on one of 4 image buttons, the text that is currently visible gets switched out to the new text. e.g., if the text "blah blah" is displaying &amp; you click on button 4, you now see "blah".</p>

<p>What I want is to take, say, "blah blah blah" and turn the middle "blah" into a link. So, essentially <code>"blah &lt;a href=http://example.com&gt;blah&lt;/a&gt; blah"</code>. I followed encoding advice like &amp;lt; or &#x3C; but the best I got was visibly seeing the "a" tag in the text, not seeing the link.</p>

<p>I feel like I'm missing something simple. Any advice is appreciated.</p>