document.setAttribute does not seem to work
<p>I wrote a simple javascript function that creates a DOM object (in this case a tag ) and I call it in the  of my html page and it doesn't seem to work. Any ideas?</p>

<pre><code>function create_link() {
    var link = document.createElement("a");
    link.setAttribute('href', 'the_link.html');
    link.setAttribute('name', 'click on link');
    document.childNodes[0].childNodes[1].appendChild(link);
}
</code></pre>
