redirecting to other page with value in javascript via click
<p>I want to create a Javascript file to do these operations:</p>

<ol>
<li>Pass the current link to the other page</li>
<li>Click on hypertext or image that is created dynamically in JavaScript file to redirect</li>
</ol>

<p>Just I want to have a Javascript link in the html body and not other thing same this :</p>

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

<p>And in the JavaScript file I have these: </p>

<pre><code>var DivTag = document.createElement("Div");
DivTag.setAttribute('ID', 'MyDivTagID');
    $(document).ready(function () {
        $("$MyDivTagID").click(function(e) {
            window.location = "http://www.MyLink.com/?Url=" + window.location;
    });
});
</code></pre>

<p>This is not working. Please help me.</p>
