How to convert html to variable in javascript?
<p>I have problem while convert html to javascript variable.
<br><br>
<strong>My HTML Code</strong></p>

<pre><code>&lt;div onclick="openfullanswer('2','Discription part','This is the code part');"&gt;
</code></pre>

<p>I want to create this html code dynamically, but I have the problem in quote(" and ')
<br><br>
<strong>I tried like below</strong></p>

<pre><code>for(i=0;i&lt;result.length;i++)
{       
        strVar +="&lt;div onclick='openfullanswer("+result[i].ReplyID+",'"+result[i].Description+"','"+result[i].Code+"');'&gt;Test code&lt;/div&gt;";
}
</code></pre>

<p><a href="https://jsfiddle.net/8782n60z/1/" rel="nofollow"><strong>https://jsfiddle.net/8782n60z/1/</strong></a></p>