Data attribute not rendering in the desired format when added dynamically ,not escaping double quotes
<p>Im trying to add a div tag dynamically with some data attributes but the data attributes are not rendering in the right format.Please find the code below</p>

<pre><code>$('&lt;a href="#" id="opendialog2" data-role="button"&gt;Open Dialog2&lt;/a&gt;&lt;div id="inlinecontent2" style="display:none" data-options="{"mode":"blank","headerText":"Yo","headerClose":true,"blankContent":true}"&gt;&lt;ul data-role="listview"&gt;&lt;li&gt;Some&lt;/li&gt;&lt;li&gt;List&lt;/li&gt;&lt;li&gt;Items&lt;/li&gt;&lt;/ul&gt;&lt;a rel="close" data-role="button" href="#"&gt;Close&lt;/a&gt;&lt;/div&gt;').appendTo('#myDiv')
</code></pre>

<p>The div inlinecontent2 is rendered as </p>

<pre><code>&lt;div mode":"blank","headertext":"yo","headerclose":true,"blankcontent":true}"="" data-options="{" style="display: none;" id="inlinecontent2"&gt;
</code></pre>

<p>The data options attributes renders all messed up</p>

<p>Im wish to get it rendered like below</p>

<pre><code>&lt;div id="inlinecontent" style="display:none" data-options='{"mode":"blank","headerText":"Yo","headerClose":true,"blankContent":true}'&gt;
</code></pre>
