Why doesn't onClick activate function? : <p>I'm trying to write a simple code in JavaScript where selecting a button calls a prompt function, but the prompt never pops. </p>

<p>This is the HTML:</p>

<pre><code>    &lt;div id="btnDiv"&gt;
    &lt;button type="submit" id="btn" onclick="submit"&gt; send info &lt;/button&gt;
    &lt;/div&gt;
</code></pre>

<p>And this is the JavaScript code:</p>

<pre><code>    document.getElementById("btn").onclick = function(){
    prompt("Thank you");
    }
</code></pre>

<p>What am I doing wrong?</p>
