What is wrong with this piece of javascript code?
<pre><code>window.addEventListener("load", run, false);

function run() {
    var links = content.document.getElementsByTagName("a");
    var x = "";
    for (var i = 0; i &lt; links.length; i++) {
        x = x + "&lt;p&gt;" + links[i] + "&lt;/p&gt;";
    }
    document.write(x);
}
</code></pre>

<p>I'm new to JavaScript, and I can't for the life of me figure it out. </p>
