Error can't call and get id from other javascript
<p>I have a index.php</p>

<pre><code>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="script.js"&gt;&lt;/script&gt;
&lt;?php
&lt;input type="hidden" value="1" /&gt;
&lt;input type="submit" id="button" value="submit"&gt;
?&gt;
</code></pre>

<p>in file script.js I using:</p>

<pre><code>$(document).ready(function(){
    $('#button').click(function(){
       var id = $(this).find('input:hidden').val();
       alert(id);
       return false;
    });
});
</code></pre>

<blockquote>
  <p>When using srcipt.js get id from index.php is result "undefined"</p>
</blockquote>
