getElemntById query for JavaScript
<p>can you please tell me why this wouldnt work? been stuck at it all day.</p>

<p>I just wanna copy whatever is enetered in the first  field, convert it to a variable and project it to the last <p> field. </p>

<p>Thank you</p>

<p>ps: needless to say i only copied the relevant bits of the code...</p>

<p>
    </p>

<pre><code>&lt;th bgcolor="#eeeee" width=12.5%&gt;Monday&lt;/th&gt;
        &lt;th bgcolor="#eeeee" width=12.5%&gt;&lt;input id="test" value="09:15" size=15&gt;&lt;/td&gt;&lt;/th&gt;
        &lt;th bgcolor="#eeeee" width=12.5%&gt;&lt;input type=time id="Monday_Breakfast_LastSeating" value="11:45" size=15&gt;&lt;/td&gt;&lt;/th&gt;

    &lt;/form&gt;
    &lt;/table&gt;

    &lt;form id="form2" id=other method=POST&gt;




        &lt;tr&gt;
            &lt;td bgcolor="#aaeeaa"align=center&gt;&lt;button onclick="myFunction()"&gt;Calculate&lt;/button&gt;&lt;/td&gt;

        &lt;/tr&gt;

    &lt;/form&gt;


    &lt;table width=40%  border=0&gt;

        &lt;th bgcolor="#eeaaaa" align=center width=33%&gt;Goal&lt;/th&gt;

    &lt;/table&gt;

    &lt;form id=result method=POST&gt;
    &lt;table width=40% border=0&gt;

        &lt;th style="border:black;" bgcolor="#eeaaaa" align=center&gt;&lt;em&gt;&lt;/em&gt; &lt;p id="calculation2" size=15&gt;N/A&lt;/p&gt;&lt;/th&gt;
        &lt;th bgcolor="#eeaaaa" align=center&gt;&lt;em&gt;&lt;/em&gt; &lt;p id="calculation3" size=15&gt;N/A&lt;/p&gt;&lt;/th&gt;
        &lt;th bgcolor="#eeaaaa" align=center&gt;&lt;p id="calc" size=15&gt;N/A&lt;/p&gt;&lt;/th&gt;

    &lt;/table&gt;
    &lt;/form&gt;

    &lt;script type="text/javascript"&gt;

    function myFunction() {

        var test = getElementById("test").value;
        document.getElementById("calc").innerHTML = test;
        }

    &lt;/script&gt;
</code></pre>
