copy html block with tags script
<p>I have such html code:</p>

<pre class="lang-html prettyprint-override"><code>&lt;div&gt; 
    &lt;div id="text"&gt;text&gt;&lt;/div&gt;
    &lt;script&gt;$("#text").val('some value');&lt;/script&gt;
&lt;/div&gt;
</code></pre>

<p>I copy this html through <code>.clone()</code> and edit html inside. Result:</p>

<pre class="lang-html prettyprint-override"><code>&lt;div&gt; 
    &lt;div id="1-text"&gt;text&gt;&lt;/div&gt;
    &lt;script&gt;$("#text").val('some value');&lt;/script&gt;
&lt;/div&gt;
</code></pre>

<p>I want to change id inside tags script. <code>$("#1-text").val('other value');</code>
How can I do it?</p>