How to include javascript file in a specific tag?
<p>Ok, I've got this function:</p>

<pre><code>/* jsHandler.js */
function inc(filename)
{
var body = document.getElementsByTagName('body').item(0);
script = document.createElement('script');
script.src = filename;
script.type = 'text/javascript';
body.appendChild(script)
}
</code></pre>

<p>What i would like is extending the script to tell js where to insert the js.file, like, say i have this in html:</p>

<pre><code>&lt;div id="mydiv"&gt;&lt;/div&gt;
&lt;iframe id="myiframe"&gt;&lt;/iframe&gt;
</code></pre>

<p>i call</p>

<pre><code>inc(this.js, mydiv)
</code></pre>

<p>to include the js.file in the div "mydiv",</p>

<p>resulting in:</p>

<pre><code>&lt;div id="mydiv"&gt;&lt;script src="this.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;
</code></pre>

<p>How do i do that?</p>
