What is the error in this program? It's showing uncaught typeerror
<p>I get the following error</p>

<blockquote>
  <p>uncaught typeerror : object is not a function</p>
</blockquote>

<p>in the code below. </p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Reverse&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form name="rev1"&gt;
Enter the string : &lt;input type="text" name="str"&gt;
&lt;input type="button" value="click" onclick="rev1()" /&gt;
</code></pre>

<p>And this is the place where I found the error:</p>

<pre><code>reverse of given string : &lt;input type="text" name="res"&gt;
&lt;/form&gt;
&lt;script type="text/JavaScript"&gt;
function rev1(){
//var a=rev1.str.value;
//document.write("hello");
alert("hello");
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>What might cause this and how do I solve it?</p>
