Without clicking the button its click event executing javascript
<p>I have a HTML form which contains a input text and a button.
<strong>HTML</strong></p>

<pre><code>&lt;form id="form1"&gt;
   &lt;input type="text" /&gt;
   &lt;button onclick='YouClick();'&gt;Click&lt;/button&gt;
 &lt;/form&gt;
</code></pre>

<p>JS function</p>

<pre><code> function YouClick() {
   alert("You just clicked");
 }
</code></pre>

<p>When user click the button , the javascript function <code>YouClick</code> executes. But if i pressed enter key on input text fields than also <code>YouClick</code> function executes. How can i stop this behaviour ? So that only by clicking the button the <code>YouClick</code> function executes.</p>
