How to call a javascript from html using an id
<p>I have the following footer html code </p>

<pre><code>&lt;footer class="footer"&gt;
        &lt;div class="container"&gt;
            &lt;p class="text-muted"&gt; &lt;a href="about.html"&gt;About Us&lt;/a&gt; | &lt;a href="contactus.html"&gt;Contact Us&lt;/a&gt;&lt;/p&gt;
            &lt;p class="text-muted"&gt;&amp;copy; Copyright of abc
                &lt;span id="yearfooter"&gt; &lt;/span&gt;
            &lt;/p&gt;
        &lt;/div&gt;
&lt;/footer&gt;
&lt;script src="scripts/abc.js"&gt;&lt;/script&gt;
</code></pre>

<p>and the following for my jscript</p>

<pre><code>$(function() {
$('#yearfooter').footer({
    document.write(new Date().getFullYear());
});
</code></pre>

<p>});</p>

<p>I'm fairly new to javascript. I'm trying to get this script to dynamically get the current year and display that in the footer. But with this, I cant seem to get the year displayed at all. I'm not sure what I'm doing wrong here.</p>