JSON.parse() cannot parse string with HTML
<p>I checked many questions but didn't see a solution. </p>

<p>I have JSON which was STRINGIFIED (containing HTML).
This JSON is stored as a string on an element.
When I try to <code>JSON.parse(str)</code> I am getting errors</p>

<p>I know that the errors are due to the special symbols \n \t etc and has to be escaped. So how to parse this string which is the JSON and have it as an object.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var obj = {
  "blocks": [{
    "frames_content": "&lt;div id=\"page\" class=\"page\"&gt;\n    \n    \t&lt;div class=\"container\" id=\"divider1\"&gt;\n    \n    \t\t&lt;div class=\"col-md-12\"&gt;\n    \n    \t\t\t&lt;hr class=\"dashed\" data-selector=\"hr.dashed\" style=\"outline: none; cursor: inherit;\"&gt;\n    \t\n    \t\t&lt;/div&gt;&lt;!-- /.col --&gt;\n    \t\n    \t&lt;/div&gt;&lt;!-- /.container --&gt;\n    \n    &lt;/div&gt;",
    "frames_sandbox": false,
    "frames_loaderFunction": "",
    "frames_height": 162,
    "frames_original_url": "/static/admin-users/pages/elements/divider1.html"
  }]
};
document.getElementById("debug").innerHTML = JSON.stringify(obj);
var str = document.getElementById("debug").innerHTML;
var x = JSON.parse(str);
console.log(x);</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="debug"&gt;&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>===== UPDATE</p>

<p>If I read the element with .text() works</p>

<p>I have one more scenario which I don't get how to solve</p>

<pre><code>&lt;script&gt;
var str = '{"pages":{"index":{"blocks":[{"frames_content":"&lt;div id=\"page\" class=\"page\"&gt;\n    \n    \t&lt;div class=\"container\" id=\"divider1\"&gt;\n    \n    \t\t&lt;div class=\"col-md-12\"&gt;\n    \n    \t\t\t&lt;hr class=\"dashed\" data-selector=\"hr.dashed\" style=\"outline: none; cursor: inherit;\"&gt;\n    \t\n    \t\t&lt;/div&gt;&lt;!-- /.col --&gt;\n    \t\n    \t&lt;/div&gt;&lt;!-- /.container --&gt;\n    \n    &lt;/div&gt;","frames_sandbox":false,"frames_loaderFunction":"","frames_height":162,"frames_original_url":"/static/admin-users/pages/elements/divider1.html"}]}},"responsiveMode":"desktop"}';

var obj = JSON.parse(str);
&lt;/script&gt;
</code></pre>

<p>Should I escape them with REGEX or what ?
What is the best way ?</p>